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

auro-checkbox: checkbox group contents not controlled if children added after connectedCallback #20

Closed
geoffrich opened this issue May 25, 2021 · 1 comment · Fixed by #30
Assignees
Labels
released Completed work has been released Status: Work In Progress Issue or Pull Request work is in Progress Type: Bug Bug or Bug fixes

Comments

@geoffrich
Copy link
Contributor

Describe the bug

If child checkboxes are added to the checkbox-group after connectedCallback has run, the checkbox-group will not control the disabled/error state of these children.

This is especially an issue in Svelte, which first appends the group (calling connectedCallback), and then appends the children. At the time connectedCallback has run, the children are not in the DOM, so this.items is empty.

Related: AlaskaAirlines/auro-accordion#18

To Reproduce

Render the following markup in Svelte:

<auro-checkbox-group disabled={true}>
	<span slot="legend">Example group</span>
	<auro-checkbox id="optionOne" name="exampleOptions" value="option one"
		>Option one</auro-checkbox
	>
	<auro-checkbox id="optionTwo" name="exampleOptions" value="option two"
		>Option two</auro-checkbox
	>
</auro-checkbox-group>

Inspect the child auro-checkbox. The disabled property is false.

Expected behavior

The component reacts to additional slotted checkboxes added after connectedCallback has run.

@geoffrich geoffrich added the Type: Bug Bug or Bug fixes label May 25, 2021
@blackfalcon blackfalcon removed their assignment May 27, 2021
@geoffrich geoffrich changed the title auro-radio: checkbox group contents not controlled if children added after connectedCallback auro-checkbox: checkbox group contents not controlled if children added after connectedCallback Aug 16, 2021
@geoffrich geoffrich added the Status: Work In Progress Issue or Pull Request work is in Progress label Aug 16, 2021
geoffrich added a commit that referenced this issue Aug 16, 2021
AuroDesignSystem pushed a commit that referenced this issue Aug 16, 2021
## [1.1.4](v1.1.3...v1.1.4) (2021-08-16)

### Bug Fixes

* **lint:** remove unnecessary ifDefined [#28](#28) ([a19fe04](a19fe04))
* **slots:** react to slot change [#20](#20) ([b99bf7f](b99bf7f))
@AuroDesignSystem
Copy link
Collaborator

🎉 This issue has been resolved in version 1.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@AuroDesignSystem AuroDesignSystem added the released Completed work has been released label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Completed work has been released Status: Work In Progress Issue or Pull Request work is in Progress Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants