Quasar: @keyup.enter propogates through q-dialogs

Created on 2 Aug 2019  路  3Comments  路  Source: quasarframework/quasar

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
2019-08-02 14 50 25

bug

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tombarfoot picture tombarfoot  路  3Comments

Bangood picture Bangood  路  3Comments

xereda picture xereda  路  3Comments

adwidianjaya picture adwidianjaya  路  3Comments

alexeigs picture alexeigs  路  3Comments