PolymerElements / paper-dropdown-menu

A Material Design browser select element
https://www.webcomponents.org/element/PolymerElements/paper-dropdown-menu
61 stars 107 forks source link

Delegate focus to the internal button #319

Closed bicknellr closed 4 years ago

bicknellr commented 4 years ago

This PR overrides _attachDom so that delegatesFocus can be set when attaching the shadow root. This is going into #317 instead of master.

bicknellr commented 4 years ago

I had to override focus() so that it focuses the correct thing even when running in Shady DOM: if all of the elements are in the same tree and the paper-dropdown-menu itself isn't focusable, then calling focus() on it would normally just cause focus to be lost. This changes it to manually focus the right thing.

edit: Internal tests look good after that change though.