Reproduction
- Open the official Choices.js demo with a single select.
- Select an option so the generated outer Choices container retains focus.
- Keep focus on the control and press F5.
Actual behavior
Before the browser reload begins, the closed dropdown opens briefly. The container receives is-open and sometimes is-flipped, producing a visible flash of the option list.
Ctrl+R and Cmd+R can exhibit the same behavior because the modifier-only Control or Meta keydown opens the closed dropdown before the R key arrives.
Expected behavior
Browser and system shortcuts such as F5, Ctrl+R, Cmd+R, and their hard-reload variants should not open a closed select. The browser reload itself should continue normally.
Investigation
Reproduced with Choices.js v11.2.4 in Chromium. The container capture-phase keydown handler reaches _onKeyDown(). When the dropdown is closed and the element is not a text input, keys other than Escape, Tab, and Shift fall through to showDropdown(). Function keys and modifier-only keys therefore use the same opening path as interactive select keys.
This is similar to the over-broad keyboard-opening behavior discussed in #1246, but the symptom here is specifically the dropdown flash immediately before a browser reload.
Reproduction
Actual behavior
Before the browser reload begins, the closed dropdown opens briefly. The container receives
is-openand sometimesis-flipped, producing a visible flash of the option list.Ctrl+R and Cmd+R can exhibit the same behavior because the modifier-only Control or Meta keydown opens the closed dropdown before the R key arrives.
Expected behavior
Browser and system shortcuts such as F5, Ctrl+R, Cmd+R, and their hard-reload variants should not open a closed select. The browser reload itself should continue normally.
Investigation
Reproduced with Choices.js v11.2.4 in Chromium. The container capture-phase keydown handler reaches
_onKeyDown(). When the dropdown is closed and the element is not a text input, keys other than Escape, Tab, and Shift fall through toshowDropdown(). Function keys and modifier-only keys therefore use the same opening path as interactive select keys.This is similar to the over-broad keyboard-opening behavior discussed in #1246, but the symptom here is specifically the dropdown flash immediately before a browser reload.