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(inline-editable): fix rendering tied to default slot content #10456

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

driskull
Copy link
Member

Related Issue: #6059

Summary

  • remove use of getSlotted utility
  • replace with slotchange event
  • 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
mutationObserverCallback(): void {
// todo: kind of odd to be setting scale based on a slotted element scale.
// would require a scale event to properly handle this which would be better than a mutation observer
this.scale = this.scale || this.inputElement?.scale;
Copy link
Member Author

Choose a reason for hiding this comment

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

Its kind of odd to be setting scale based on a slotted element's scale.

To handle this better, an internal event for scale change would be needed.

IMO we should just remove this. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem with this is that if inputElements scale changes after being slotted, this wouldn't get picked up.
If inputElement is replaced after initialization then the scale is already set at that point too.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Can you create an issue for this?

@geospatialem @brittneytewks We can plan for removal in a breaking change.

Copy link
Member Author

Choose a reason for hiding this comment

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

@driskull driskull marked this pull request as ready for review September 30, 2024 22:39
@driskull driskull changed the title fix(inline-editable): properly handle slotted elements fix(inline-editable): 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.

Noice! 🎉

Title might need to be tweaked since this fixes default slot rendering.

mutationObserverCallback(): void {
// todo: kind of odd to be setting scale based on a slotted element scale.
// would require a scale event to properly handle this which would be better than a mutation observer
this.scale = this.scale || this.inputElement?.scale;
Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Can you create an issue for this?

@geospatialem @brittneytewks We can plan for removal in a breaking change.

@driskull driskull changed the title fix(inline-editable): fix rendering tied to named-slot content fix(inline-editable): fix rendering tied to default slot content Oct 1, 2024
@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 7abe7d4 into dev Oct 1, 2024
18 checks passed
@driskull driskull deleted the dris0000/inline-editable-getSlotted-fix-2 branch October 1, 2024 17:09
@github-actions github-actions bot added this to the 2.13.1 patch milestone Oct 1, 2024
benelan added a commit that referenced this pull request Oct 7, 2024
* origin/dev: (230 commits)
  chore: release next
  chore(sort-handle): add messages (#10474)
  feat(accordion-item): stretch slotted actions to fill its height (#9250)
  chore: release next
  feat(dialog, modal, popover, input-date-picker,  input-time-picker, sheet): support stacked component sequential closing with escape (#9231)
  chore: remove commented-out code (#10478)
  chore: add cssrem VSCode extension recommendation (#10300)
  docs(accordion-item): fix deprecation tag (#10479)
  chore: release next
  feat(stepper-item): update component's active state background color. (#10475)
  refactor: use `requestAnimationFrame` to replace `readTask` (#10432)
  chore: release next
  fix(tip): fix rendering tied to named-slot content (#10470)
  ci: compile estimate totals per milestone (#10442)
  chore: release next
  fix(modal): fix rendering tied to named-slot content (#10469)
  chore: release next
  fix(shell-center-row): fix rendering tied to named-slot content (#10451)
  fix(inline-editable): fix rendering tied to default slot content (#10456)
  fix(input, input-number, input-text): should not set slotted actions to be disabled (#10458)
  ...
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