Vaadin-checkbox cycling states

Hi,

I was wondering how you would go about making the vaadin-checkbox cycle through all the states when clicked. I have it starting at the indeterminate state then it only cycles through checked and un-checked states. I’d like it to also cycle back to indeterminate as well in case the checkbox was incorrectly set.

Is that possible?

When exactly do you want it to go to indeterminate state? Programmatically you can do it with property
this.$.mycheckbox.indeterminate=true
. If you want it to cycle through all three states [off, on, indeterminate]
then I don’t see a readymade feature for that. I guess you could listen to checked-changed event and when the checkbox goes from on->off, you call
this.$.mycheckbox.indeterminate=true
.

I just released an add-on for Vaadin Flow that essentially does exactly that. There were some other hurdles to overcome as well for a working result. Cheers

https://vaadin.com/directory/component/indeterminate-checkbox