Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new DOM API internally #226

Open
1 task
debois opened this issue Sep 9, 2016 · 0 comments
Open
1 task

Use new DOM API internally #226

debois opened this issue Sep 9, 2016 · 0 comments
Milestone

Comments

@debois
Copy link
Owner

debois commented Sep 9, 2016

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.

@debois debois added this to the v8 milestone Sep 9, 2016
@aforemny aforemny modified the milestones: v8, v9 Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants