-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Symfony 2.8.11 - Form choice
's options are inheriting id and name of parent select
#19898
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
Comments
Issue seems to be this https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_attributes.html.php#L1 since it's the parent's form object passed here https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php#L11. I don't see a need for https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_attributes.html.php#L1 so maybe that can just be removed? |
Actually both lines 1 and 2 - if the select is disabled, it adds disabled to all options making it impossible to get the fixed value via JS. https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_attributes.html.php#L1-L2 |
Thanks @alanhartless for reporting this, indeed this line should be removed. See #19904. Status: reviewed |
…Dude) This PR was merged into the 2.7 branch. Discussion ---------- [Form] Fixed collapsed ChoiceType options attributes | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19898 | License | MIT | Doc PR | ~ Commits ------- 7806e2a Fixed collapsed ChoiceType options attributes
I had an override for
choice_widget_options.html.php
as a work around for #19016. I noticed that has since been fixed so wanted to give it a try. When I removed the override to use stock, I noticed that each option of the select inherited it'sid
andname
attributes as well. This caused issues for me with JSgetElementById()
. Should a check be in place to not set the parent's id and name?The text was updated successfully, but these errors were encountered: