Skip to content

[LiveComponent] Fix default select value with preferred choices - #2587

Merged
Kocal merged 1 commit into
symfony:2.xfrom
1ed:fix-preferred-choices-default-value
Mar 3, 2025
Merged

[LiveComponent] Fix default select value with preferred choices#2587
Kocal merged 1 commit into
symfony:2.xfrom
1ed:fix-preferred-choices-default-value

Conversation

@1ed

@1ed 1ed commented Feb 21, 2025

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? no
Issues -
License MIT

When there are preferred_choices set for a choice type Symfony
renders them before the actual choices so the default value in the
browser will be the first value of the preferred choices.

@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Feb 21, 2025
@smnandre

Copy link
Copy Markdown
Member

Thank you @1ed !


Thinking out loud here... I'm less and less enjoying this whole mecanism.

I'm starting to wonder if we should not revert it.. instead of trying to decide PHP-side how the browsers behave 🤷‍♂️

Comment thread src/LiveComponent/src/ComponentWithFormTrait.php Outdated
@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Feb 22, 2025
@1ed
1ed force-pushed the fix-preferred-choices-default-value branch from 080d402 to 6dc6a33 Compare February 22, 2025 23:30
@1ed

1ed commented Feb 22, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @1ed !

Thinking out loud here... I'm less and less enjoying this whole mecanism.

I'm starting to wonder if we should not revert it.. instead of trying to decide PHP-side how the browsers behave 🤷‍♂️

Probably would be better yes, but I don't know the internals, why was this necessary originally, just wanted to fix the bug.

@smnandre

Copy link
Copy Markdown
Member

Of course, and thank you again for that !

It was really thinking outloud :))

@Kocal Kocal changed the title [Live] Fix default select value with preferred choices [LiveComponent] Fix default select value with preferred choices Mar 3, 2025
@Kocal

Kocal commented Mar 3, 2025

Copy link
Copy Markdown
Member

Thank you @1ed.

@Kocal
Kocal merged commit 8a11743 into symfony:2.x Mar 3, 2025
@1ed
1ed deleted the fix-preferred-choices-default-value branch March 3, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix LiveComponent Status: Reviewed Has been reviewed by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants