Skip to content

key is more reliable with child components #2699

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

Merged
merged 1 commit into from
May 23, 2025

Conversation

weaverryan
Copy link
Member

Q A
Bug fix? yes
New feature? no
Docs? yes
Issues Fix #1643
License MIT

I couldn't track down why, but for child components, key is more reliable. When id is used and a child requires re-rendering (because input props changed), the dummy element returned by https://github.com/symfony/ux/blob/2.x/src/LiveComponent/src/EventListener/InterceptChildComponentRenderSubscriber.php will not have an id, but with key it will. Smells like a bug, but key works

@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Apr 27, 2025
@smnandre
Copy link
Member

Do you have a concrete example/setup so we can track this done later ?

@smnandre smnandre added docs Improvements or additions to documentation LiveComponent Status: Reviewed Has been reviewed by a maintainer and removed Bug Bug Fix Status: Needs Review Needs to be reviewed labels Apr 30, 2025
Kocal added a commit that referenced this pull request May 23, 2025
This PR was merged into the 2.x branch.

Discussion
----------

docs: remove oldest versionadded

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | yes
| Issues        | Fix #...
| License       | MIT

A while back, I removed the oldest `@versionadded` annotations—`@weaverryan` reminded me of this in #2699.
This PR repeats that cleanup by dropping any `@versionadded` tags that are more than two years old.

Commits
-------

6fad96d docs: remove oldest versionadded
symfony-splitter pushed a commit to symfony/ux-autocomplete that referenced this pull request May 23, 2025
This PR was merged into the 2.x branch.

Discussion
----------

docs: remove oldest versionadded

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | yes
| Issues        | Fix #...
| License       | MIT

A while back, I removed the oldest `@versionadded` annotations—`@weaverryan` reminded me of this in symfony/ux#2699.
This PR repeats that cleanup by dropping any `@versionadded` tags that are more than two years old.

Commits
-------

6fad96dd4b5 docs: remove oldest versionadded
symfony-splitter pushed a commit to symfony/ux-live-component that referenced this pull request May 23, 2025
This PR was merged into the 2.x branch.

Discussion
----------

docs: remove oldest versionadded

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | yes
| Issues        | Fix #...
| License       | MIT

A while back, I removed the oldest `@versionadded` annotations—`@weaverryan` reminded me of this in symfony/ux#2699.
This PR repeats that cleanup by dropping any `@versionadded` tags that are more than two years old.

Commits
-------

6fad96dd4b5 docs: remove oldest versionadded
@Kocal
Copy link
Member

Kocal commented May 23, 2025

Thank you @weaverryan.

@Kocal Kocal merged commit 6f2fa9c into symfony:2.x May 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation LiveComponent Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: The data-live-preserve attribute requires an id attribute
4 participants