-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
q-btn in q-field is incorrectly triggering click event #17005
Comments
Most likely what caused this is getting rid of the after diving into the codebase I've found out that we had a browser a11y and autofilling violation which is fixed by now in (v2.13.1 +) but we are facing an event capturing issue which is caused by the solution of the first issue (not setting chrome or browser yellings about a11y violations with an example:First: Second: As you can see, Chromes warning is quiet logical !! when the value of I was thinking of a Why Event capturing with label tag only ?
Why we did not have the event capturing issue before ?we had a11y browser violation but we did not have event capturing since the label was only triggering the event based on the passed that means when we use label tag we should declare a specific in another word, there are two possible ways:
Since the QField component is created to work in both cases seamlessly, Its kinda a bit tricky to decide for a concise solution! I hope, it helps to clarify the core concept, Thanks <3 |
Based on my understanding of this and the codebase, I've come up with an idea. so far, i think it is the right approach and I've created this Pull Request. which closes [ #17005, #16589, #16671, #16883 ] Remembering the cause of the issue, which is getting rid of to prevent this violation, we have to know what QField is for ! which is a form wrapper right ? but a custom component form wrapper or a form control field wrapper ? let's catch the first and say, a custom component form wrapper, then it is pretty easy we'd pass the tag property as and for the second we change the tag property to well not quiet yet, you know there are many softwares using Quasar, without providing the property and they encounter this a11y violation (without even noticing). even quasar QField examples/usages, we should go and change every one of them and provide the tag property as thus, i wanted the least change, i got another magic touch. and changed the default value of tag property from label to then, about the usage of QField in other components ? does this change breaks anything ? to conclude this, the bug (event triggering) should have more priority than a11y violation which can be fixed after providing the tag property therefore i have updated the documenation, i found it handy to mention the importance of tag property. Thanks for your time <3 |
What happened?
q-btn in q-field is incorrectly triggering click event. Clicking on an area outside q-btn will also trigger the click event of q-btn.
Version 2.13.0 works fine, this problem occurs with version 2.13.1 and above.
What did you expect to happen?
The click event should only be fired when q-btn is clicked.
Reproduction URL
https://codepen.io/gefan/pen/PogGxvG
How to reproduce?
The link below is the same example in version 2.13.0, clicking on the white area will not trigger the click event of q-btn.
https://codepen.io/gefan/pen/PogGxMG
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar)
Platforms/Browsers
Chrome
Quasar info output
No response
Relevant log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: