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

refactor: convert SlotTargetMixin to controller #3326

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

web-padawan
Copy link
Member

Description

There is a number of issues with the current SlotTargetMixin implementation:

  1. Unclear initialization order, e.g. using ready() vs consumer components using connectedCallback()
  2. Nodes are currently copied in the constructor. It would be more reliable to use hostConnected() instead.
  3. A reference to the slot target is only stored once, while in some edge cases it might change dynamically.

Fixes #3323

Type of change

  • Bugfix + Refactor

Note

You can test this PR by downloading project from start.vaadin.com (Master Detail view, Java + HTML).

@web-padawan web-padawan force-pushed the refactor/slot-target-controller branch from 31e68ec to 3762116 Compare January 21, 2022 12:35
@sonarcloud
Copy link

sonarcloud bot commented Jan 21, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
6.8% 6.8% Duplication

Copy link
Member

@tomivirkki tomivirkki left a comment

Choose a reason for hiding this comment

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

Verified that the change fixes the issue.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 23.0.0.alpha4 and is also targeting the upcoming stable 23.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[checkbox] Default slot content disappears in Start (Java + HTML view)
3 participants