ing-bank / lion

Fundamental white label web component features for your design system.
https://lion-web.netlify.app/
MIT License
1.74k stars 292 forks source link

Indeterminate checkbox combined with disabled #1504

Open toonverm opened 2 years ago

toonverm commented 2 years ago

Expected behavior

If we combine indeterminate-checkbox combined with a disabled checkbox it should not be able to set the state to checked.

Actual Behavior

If we combine indeterminate-checkbox combined with a disabled checkbox and we check the parent Its state is changed to checked and the state of the lion-checkbox is also checked.

https://webcomponents.dev/edit/02sTc3d2PMYkqhBC9RGJ/package.json

Additional context

"name": "@lion/checkbox-group", "version": "0.18.5",

jorenbroekema commented 2 years ago

Hey, thanks for raising the issue, bug confirmed indeed.

So if I see correctly, the fix is:

const state = this._subCheckboxes
  .filter(checkbox => !checkbox.checked)
  .filter(checkbox => !checkbox.disabled)
  .length > 0;

adding the !disabled filter? Seems reasonable to me, you up for creating a pull request with this fix?