Open jpodwys opened 7 years ago
Let's celebrate the one month anniversary of this issue/pr combo by merging my PR! What do ya say?
@bicknellr @notwaldorf @cdata @rictic
Hi @jpodwys, have you considered listening for the down key and setting the selected item to the first when the user pushes that? I think that's the typical way to handle this scenario if this is a generic input field with suggested options. I think you can also set .selected
directly to avoid the focusing behavior.
Description
Currently, calling
paper-listbox.select(n);
causes the referenced list item to receive focus. This is problematic when users are typing with IME because stealing focus from the input that triggers the OS-level IME popup causes that popup to disappear.More Info
I have a date/location picker typeahead. When the user types into the input, I open a
paper-listbox
instance and programmatically select the first item for them. Because doing so steals focus, I then immediately replace focus to the input. However, blurring the input causes IME tools to disappear.Expected outcome
I would like to have an opt-in way to prevent focus of the selected list item, perhaps via a property named
preventFocusOnItemChanged
or something similar. I'd like for the desired item to be highlighted, but not focused. I've put together #97 (which has a diff of only 9 lines added) to accomplish this.Live Demo
Steps to reproduce
options
property when a user types (preferably with a slight delay simulating a network call)iron-menu-behavior
blurs the input causing the IME menu to disappear as seen in the gif aboveBrowsers Affected