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

CFormCheckbox - HTML checked attribute not working as expected #279

Closed
jgulledge19 opened this issue Feb 12, 2024 · 1 comment
Closed

CFormCheckbox - HTML checked attribute not working as expected #279

jgulledge19 opened this issue Feb 12, 2024 · 1 comment

Comments

@jgulledge19
Copy link

jgulledge19 commented Feb 12, 2024

This is either a bug or just a confusing set up, or maybe it is just me.

Issue: the HTML attribute checked works only if value and v-model Vue properties are not used. If they are used then the checked attribute is ignored.

Simple toggle examples

I have been using Core UI 4 for a while and in v4.8.1 and below this working example: https://playcode.io/1759963, both checkboxes worked, now only one of them works.

Using a checkboxes in a list of say related models, attaching one to many:

Example: https://playcode.io/1759889

What I found

  • By default when using v-model, it is now reactive as a bool - this seems to be the Vue way of doing things.
  • You can use the checked HTML attribute. But the checked attribute is not reactive and it cannot be used in combination with the value and v-model properties.
    • I would have expected that you could use checked along with value. I assume that value should be static as far as the component is concerned. It does make sense to make the v-model a reactive bool and if used then it would determine if it is checked or not.
    • In my use case, I had created a component and did not want to use v-model as I had a listener, @input, emitting the $event and value and the parent update the data model and then push back to the component the selected list via a property selectedValues. I have since refactored my component to work with v4.10.2+ so I am in no need of a quick fix.

Maybe just some clarity on the docs if you wish to keep the logic as is.

  • Operating system and version Windows 11 and macOS
  • Browser and version - all Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser

Vue Core UI 4 has been a great tool! Thanks for reviewing!

@mrholek
Copy link
Member

mrholek commented Mar 10, 2024

@jgulledge19 I released v5.0.0-rc.2, can you check it?

@mrholek mrholek closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants