Text inputs inside dropdown not working
Summary
After upgrading from 2.6 to 3.2.3 text inputs inside dropdowns not working anymore
Steps to Reproduce
- Go to https://preline.co/pro/examples/dropdowns.html#assign
- Try to type on the input field
Poking around the code I think the issue is related to HSAccessibilityObserver overriding the events but not sure.
Demo Link
https://preline.co/pro/examples/dropdowns.html#assign
Expected Behavior
I should be able to type on the input
Actual Behavior
I'm not able to type on the input, sometimes typing numbers work which makes the bug even stranger.
Screenshots
No response
As a hotfix I added stopImmediatePropagation to the relevant inputs keydown event.
I can confirm I'm seeing the same issue. I tried the chat bubble example on the demo page and couldn't type because focus is stolen on every keystroke.
Adding stopImmediatePropagation to the input keydown handler seems like a good enough workaround for now. Here's what works for me in a Stimulus controller:
connect() {
this.element.addEventListener("keydown", event => {
event.stopImmediatePropagation()
})
}