Describe the bug
setup:
a q-input
with @keydown.enter
event that closes a q-dialog its in (via plugin component)
when the event is fired the q-dialog gets closed, but the @enter propogates to the q-btn which was used to open that dialog.
It is because the q-btn is firing a @click event when it has focus and detects @keydown.enter (or keyup?)
Codepen/jsFiddle/Codesandbox (required)
https://codepen.io/mesqueeb/pen/aeyqoL
Expected behavior
the keydown/up event to not propogate
GIF
You just placed the hide
call in the wrong event - it should go in @keyup
https://codepen.io/anon/pen/MNvzMx?editors=0010
@pdanpdan thanks!!! It works when I use keyup
instead.
Do you know why?
Because the buttons listen for keyup to trigger. If you close the dialog on keydown the button would receive focus and react on keyup.
Most helpful comment
Because the buttons listen for keyup to trigger. If you close the dialog on keydown the button would receive focus and react on keyup.