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
{{ message }}
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
If focus() is called on a disabledpaper-checkbox, it actually becomes focused (i.e. it is the activeElement). This does not match the behavior of, say, a <button> which cannot be focused when disabled.
This can trip up a user that has a paper-checkbox in a <dialog> for which showModal is called. The dialog automatically focuses the first focusable element. If that's a disabled paper-checkbox, the result will be unexpected.
this would help for custom elements, but not for <button> or <input> (which are focusable without a tabindex).
in the case of default focusable elements like <input>, there's really no good way to ignore it from being focused when a <dialog> is shown modally, as they're either a form control element or have the "tab index customization flag" if you use tabindex="-1" and therefore qualify as a control in https://html.spec.whatwg.org/#dialog-focusing-steps
just FYI.
strawman:
this.removeAttribute('tabindex');if(this.tabIndex>=0)this.tabIndex=-1;// TODO(somebody): this doesn't work well in <dialog>#showModal().
@danbeam native elements don't use IronControlState, so I don't know how we'd ever fix that. If the behaviour of a native <input> inside a native <dialog> is broken, that sounds like a spec but, or a browser bug, but absolutely not something we can fix... :(
Description
If
focus()
is called on adisabled
paper-checkbox
, it actually becomes focused (i.e. it is theactiveElement
). This does not match the behavior of, say, a<button>
which cannot be focused when disabled.This can trip up a user that has a
paper-checkbox
in a<dialog>
for whichshowModal
is called. The dialog automatically focuses the first focusable element. If that's a disabledpaper-checkbox
, the result will be unexpected.Live Demo
http://jsbin.com/kobemoq/edit?html,output
Browsers Affected
The text was updated successfully, but these errors were encountered: