Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

INPUT_SELECTOR limits use of custom buttons #26

Closed
bennypowers opened this issue Feb 24, 2019 · 1 comment
Closed

INPUT_SELECTOR limits use of custom buttons #26

bennypowers opened this issue Feb 24, 2019 · 1 comment

Comments

@bennypowers
Copy link

Consider:

<details id="update-dialog" hidden>
  <summary>New Version</summary>
  <details-dialog>
    <h1>New Version Available!</h1>
    <p>Reload the Page?</p>
    <mwc-button id="dialog-reload">OK</mwc-button>
    <mwc-button data-close-dialog>Cancel</mwc-button>
  </details-dialog>
</details>

This will fail entirely, since the requisite inputs are not found when the element boots up.

By adding mwc-button to the INPUT_SELECTOR, expected behaviour is restored.

I recommend adding a special attribute to the list, like so:

<details id="update-dialog" hidden>
  <summary>New Version</summary>
  <details-dialog>
    <h1>New Version Available!</h1>
    <p>Reload the Page?</p>
    <mwc-button data-dialog-input id="dialog-reload">OK</mwc-button>
    <mwc-button data-dialog-input data-close-dialog>Cancel</mwc-button>
  </details-dialog>
</details>
@muan
Copy link
Contributor

muan commented Mar 14, 2019

Hi! Thanks for the issue. Just to give you an update- we are looking into this and want to come up with a solution that can best ensure these elements are indeed focusable to guard against human errors. We are going to look into how we might be able to work better with delegatesFocus shadow roots (in <mwc-button>'s case).

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

No branches or pull requests

2 participants