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

FormWidget: setAttribute() changes before deliver() can be lost. #452

Open
wkeese opened this issue Jun 16, 2016 · 0 comments
Open

FormWidget: setAttribute() changes before deliver() can be lost. #452

wkeese opened this issue Jun 16, 2016 · 0 comments

Comments

@wkeese
Copy link
Member

wkeese commented Jun 16, 2016

Although FormWidget works properly for declarative creation and normal programmatic creation (new MyWidget({...})), setAttribute() after a register.createElement("my-widget") call won't be handled correctly:

var w = register.createElement("my-widget");
w.foo = 123;
w.setAttribute("aria-label", "...");

In this case the setAttribute() call occurs before the focusNode has been created, so presumably the setAttribute() call is a no-op.

The solution is presumably that in that case FormWidget#setAttribute() should just set the attribute on the root node, and then it will be moved to the correct node later, in FormWidget#postRender().

Note that the case below works fine since the DOM structure is created before the new returns:

var w = new MyWidget({ foo: 123 });
w.setAttribute("aria-label", "...");
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

1 participant