Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QBtn - event prevention #12385

Closed
Kylyi opened this issue Feb 7, 2022 · 4 comments
Closed

QBtn - event prevention #12385

Kylyi opened this issue Feb 7, 2022 · 4 comments
Assignees
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vue-cli-plugin kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@Kylyi
Copy link

Kylyi commented Feb 7, 2022

What happened?

I have a chat component where you can fill an input with text and send the message via button.
On mobile device, I would like to keep focus inside the input element after I click the button so the virtual keyboard does not hide.

Without Quasar, I would use a very simple button with @mousedown.prevent but that doesn't seem to work for QBtn.

Note: Refocusing the input on btn click or mouseup will make the virtual keyboard jump which I'd like to prevent.
Note 2: Refocusing the input on btn mousedown doesn't seem to do anything.

What did you expect to happen?

The @mousedown.prevent should prevent the button from getting focused

Reproduction URL

https://codepen.io/Kylyi/pen/ExbZKrw?editors=101

How to reproduce?

  1. Focus the input if it is not already focused
  2. (optional) write something into the input
  3. Click the first button (the standard <button>) -> the input should stay focused
  4. Click the second button (the <q-btn> -> the input gets blurred

Flavour

Vue CLI Plugin (vue-cli-plugin-quasar)

Areas

Components (quasar)

Platforms/Browsers

No response

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@Kylyi Kylyi added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Feb 7, 2022
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vue-cli-plugin labels Feb 7, 2022
@hawkeye64
Copy link
Member

@Kylyi Look at @rstoenescu 's answer here: #12110

@rstoenescu
Copy link
Member

Valid claim. He IS using mousedown.prevent

@rstoenescu rstoenescu reopened this Feb 13, 2022
@rstoenescu rstoenescu self-assigned this Feb 13, 2022
rstoenescu added a commit that referenced this issue Feb 14, 2022
@rstoenescu
Copy link
Member

Enhancement will be available in Quasar v2.5.6.

Correct way to prevent: @keydown.enter.space.prevent @mousedown.prevent @touchstart.prevent

pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 14, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 14, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 14, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 15, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 15, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 15, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 17, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 17, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 17, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 18, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 22, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Feb 22, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 8, 2022
… @mousedown.prevent @touchstart.prevent) - backport from Qv2 quasarframework#12385
rstoenescu pushed a commit that referenced this issue Mar 8, 2022
….enter.space.prevent @mousedown.prevent @touchstart.prevent) #12385 (#12465)
@philippedasilva-orizone

@rstoenescu I believe the changes made to solve that issue introduced back some validation errors with: "non-passive event listenter to a scroll-blocking 'touchstart' event"
You can clearly see it when going to the QBtn component page in the documentation (console warnings)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vue-cli-plugin kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

4 participants