You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New DOM API gives us a way to work with focus and scroll position, allowing us to get rid of the majority of inline JS hacks, in particular this one.
Unfortunately, this new API requires elements to be focused to have a unique id attribute, which means we'll have to give every component using it an init which generates such unique ids. Best way to implement this I can think of is:
add id : String to Material.model (seed id)
add initializer for this id to Material.init
let components that need unique ids generate them from their parts indexes and this seed id.
(Generalize @vipentti's beautiful idea embodied in Material.Options.Internal.inject to inject also seed id, currently in Initial implementation of Custom Event support #179, shortly in master. TEA users will have to inject ids manually using Options.id).
The current DOM API is known to have concurrency issues (see this discussion and linked Gists): You measure or set focus by issuing Tasks, so both your measure and your set command may take effect at the wrong time. I'm not sure how bad this will be in practice, but we do have to make sure we think about it, so I leave a checkbox for it here:
Review DOM API PR for concurrency issues
Altogether, we desperately want to get rid of the JS hacks, so I think we want this, even though it'll be a hassle for both us and users.
The text was updated successfully, but these errors were encountered:
New DOM API gives us a way to work with focus and scroll position, allowing us to get rid of the majority of inline JS hacks, in particular this one.
Unfortunately, this new API requires elements to be focused to have a unique
id
attribute, which means we'll have to give every component using it aninit
which generates such unique ids. Best way to implement this I can think of is:id : String
toMaterial.model
(seed id)Material.init
(Generalize @vipentti's beautiful idea embodied in
Material.Options.Internal.inject
to inject also seed id, currently in Initial implementation of Custom Event support #179, shortly in master. TEA users will have to inject ids manually usingOptions.id
).The current DOM API is known to have concurrency issues (see this discussion and linked Gists): You measure or set focus by issuing Tasks, so both your measure and your set command may take effect at the wrong time. I'm not sure how bad this will be in practice, but we do have to make sure we think about it, so I leave a checkbox for it here:
Altogether, we desperately want to get rid of the JS hacks, so I think we want this, even though it'll be a hassle for both us and users.
The text was updated successfully, but these errors were encountered: