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

[LionCheckboxIndeterminate] #1967

Open
nbamfordcirium opened this issue Apr 19, 2023 · 0 comments
Open

[LionCheckboxIndeterminate] #1967

nbamfordcirium opened this issue Apr 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@nbamfordcirium
Copy link

nbamfordcirium commented Apr 19, 2023

Expected behavior

LionCheckboxIndeterminate should have the appropriate state (checked, unchecked, or indeterminate) based on the state of its child checkbox elements when it is first created.

Actual Behavior

The last child checkbox element state is never processed and hence the indeterminate checkbox state is incorrect in some cases.

Subsequently changing the state works as expected.

https://studio.webcomponents.dev/edit/lqw33LqYQlzL0LC3rwzI

Additional context

lion-checkbox-group 0.21.1

The problem seems to be in LionCheckboxIndeterminate on line 209:

_onRequestToAddFormElement() {
    this._setOwnCheckedState();
}

According to the comments for FormRegistrartMixin, _onRequestToAddFormElement is called before the element is added, so the current checkbox element being added will never be visible when _setOwnCheckedState is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants