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

fix(combobox-item): fix rendering tied to named-slot content #10450

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

driskull
Copy link
Member

@driskull driskull commented Sep 30, 2024

Related Issue: #6059

Summary

  • remove use of getSlotted utility
  • replace with slotchange event and @State variables to update the display of elements.
  • existing tests should suffice

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Sep 30, 2024
// --------------------------------------------------------------------------
//
// Lifecycle
//
// --------------------------------------------------------------------------

connectedCallback(): void {
// todo: refactor: if grandparent is removed, this will not update
this.ancestors = getAncestors(this.el);
Copy link
Member Author

@driskull driskull Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if grandparent is removed, I think this would get stale and incorrect. I don't think it would update because connectedCallback of a grandparent wouldn't trigger anything here.

Do we want to open an issue for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should revisit this. Can you create an issue to refactor this logic and possibly move it up to combobox?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created #10459

@driskull driskull marked this pull request as ready for review September 30, 2024 22:35
@driskull driskull changed the title fix(combobox-item): properly handle slotted elements fix(combobox-item): fix rendering tied to named-slot content Sep 30, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🌮🦖

// --------------------------------------------------------------------------
//
// Lifecycle
//
// --------------------------------------------------------------------------

connectedCallback(): void {
// todo: refactor: if grandparent is removed, this will not update
this.ancestors = getAncestors(this.el);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should revisit this. Can you create an issue to refactor this logic and possibly move it up to combobox?

@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Oct 1, 2024
@driskull driskull merged commit fcd4ed0 into dev Oct 1, 2024
17 checks passed
@driskull driskull deleted the dris0000/combobox-item-getSlotted-fix branch October 1, 2024 16:22
@github-actions github-actions bot added this to the 2.13.1 patch milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants