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

Lazy Rules Stays Lazy After First Blur #17456

Open
xarmin-dev opened this issue Aug 23, 2024 · 2 comments
Open

Lazy Rules Stays Lazy After First Blur #17456

xarmin-dev opened this issue Aug 23, 2024 · 2 comments
Labels
area/components bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@xarmin-dev
Copy link

What happened?

When a QInput is configured with :lazy-rules=true, validation does not occur until the first blur, as expected. After the first blur, validation only occurs on subsequent blurs, and does not occur as changes are made to the model.

What did you expect to happen?

As stated in the documentation:

lazy-rules: If set to boolean true then it checks validation status against the 'rules' only after field loses focus for first time.

Validation should occur on the first blur. After the first blur, validation should occur with changes to the model.

Reproduction URL

https://codepen.io/xarmin/pen/vYqjJav?editors=101

How to reproduce?

  1. Enter text into the input.
  2. Blur the input.
  3. Make changes to the input to fulfill validation requirements.
  4. Observe that validation does not update.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Firefox

Quasar info output

No response

Relevant log output

No response

Additional context

This behavior also occurs on the Quasar documentation site for QInput:
https://quasar.dev/vue-components/input#example--lazy-rules

I believe this behavior changed at some point, based on past projects and various GitHub conversations I have found. This change does not seem intentional.

@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Aug 23, 2024
@yusufkandemir
Copy link
Member

Yes, it was changed in 5c9a579, 8 months ago. It was an intentional change, but that doesn't mean we are happy with the result. We will introduce a new lazy-rules mode, e.g. lazy-rules="eager" to get the old result. You would be surprised to hear that the new weird behavior has a use case in the real world. In my opinion, a new type of option should've been added to support the "weird" behavior instead of updating the existing behavior, but this is what we can do now.

@yusufkandemir yusufkandemir added bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. and removed bug/1-repro-available A reproduction is available and needs to be confirmed. labels Aug 23, 2024
@xarmin-dev
Copy link
Author

Well, there you go! It seems I need to pay closer attention to the change logs...

I agree that it would have been better to add an option for the "weird" behavior, instead of changing what had already been established (and seemed to make sense). But, that might just be my stubbornness talking.

Thanks for the reply! I will find a workaround for now. Looking forward to the new mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants