-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Modern UI] Fix select2 search autofocus #9533
[Modern UI] Fix select2 search autofocus #9533
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure giving ability to redefine the dropdownParentSelector
will be really usefull.
If the auto
case, which seems to be the only one used here, is fixing the issue, then I am not in favor to add this amount of code in order to add an option we are not using.
94a809e
to
c61868b
Compare
cf8aeba
to
0b8c213
Compare
@cconard96 Do you know any usecase where using a custom parent selector could be useful ? |
Not at this point. I'll remove that option and simplify the code. |
51b064a
to
d5a96cb
Compare
bb1ebcb
to
09a57cd
Compare
This fixes two issues with the search input focus:
Search not auto focusing in jQuery 3.6.0 select2/select2#5993
As a workaround, we need to manually set the focus when the dropdown is opened. The user can still use the arrow keys to select an option when the search is focused.
dropdownParent
property during the select2 initialization. I added the ability to manually specify the dropdown parent selector or by default it automatically uses the parent modal or document body (select2 default).