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

restoreFocusOnClosed is a boolean with a default true value which cannot be set to false #101

Open
fejesjoco opened this issue Aug 20, 2016 · 3 comments

Comments

@fejesjoco
Copy link

https://www.polymer-project.org/1.0/docs/devguide/properties#configuring-boolean-properties says:

For a Boolean property to be configurable from markup, it must default to false. If it defaults to true, you cannot set it to false from markup, since the presence of the attribute, with or without a value, equates to true. This is the standard behavior for attributes in the web platform.

But paper-menu-button contains this:

          restoreFocusOnClose: {
            type: Boolean,
            value: true
          },

The default should be false (and the logic could be negated so that it's named noRestoreFocusOnClose).

@fortuna
Copy link

fortuna commented Apr 27, 2017

I'm having issues with this too. Is there a way to set restoreFocusOnClose to false on the markup?

@fortuna
Copy link

fortuna commented Apr 27, 2017

It seems like this could be fixed by changing the default to false, but making it true on hostAttributes.

@fortuna
Copy link

fortuna commented Apr 27, 2017

To work around the issue, you can override the default on your own code by doing this:

Polymer.PaperMenuButton.prototype.properties.restoreFocusOnClose.value = false;

Make sure to run this only after you loaded paper-button-menu.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants