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

Keep preferred_choices order for choice groups #34083

Open
wants to merge 2 commits into
base: 4.3
from

Conversation

@vilius-g
Copy link
Contributor

vilius-g commented Oct 23, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

Since 4.3 ordering of preferred_choices is preserved when displaying form. But this only works for flat options. When the choices are grouped, the preferred groups are in default order.

Now the preferred choice group order is derived by taking the first matching choice from preferred_choices and using its position to sort the groups.

@vilius-g vilius-g force-pushed the vilius-g:optgroup-preffered-ordering branch from bf793b2 to 97ed3bf Oct 23, 2019
@nicolas-grekas nicolas-grekas added this to the 4.3 milestone Oct 23, 2019
@xabbuh xabbuh added the Form label Oct 24, 2019
Copy link
Member

nicolas-grekas left a comment

(with minor CS comment)

@vilius-g vilius-g requested a review from xabbuh as a code owner Nov 6, 2019
@vilius-g vilius-g force-pushed the vilius-g:optgroup-preffered-ordering branch from d33285a to 0572b1d Nov 6, 2019
@vilius-g vilius-g requested review from dunglas, lyrixx and sroze as code owners Nov 6, 2019
@vilius-g vilius-g force-pushed the vilius-g:optgroup-preffered-ordering branch from 0572b1d to d31120d Nov 6, 2019
@vilius-g vilius-g force-pushed the vilius-g:optgroup-preffered-ordering branch from d31120d to 8afaaff Nov 6, 2019
@xabbuh xabbuh reopened this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.