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

Select2 is not working in opened modal by default #3609

Closed
cotur opened this issue Apr 14, 2020 · 1 comment · Fixed by #3619
Closed

Select2 is not working in opened modal by default #3609

cotur opened this issue Apr 14, 2020 · 1 comment · Fixed by #3619

Comments

@cotur
Copy link
Contributor

cotur commented Apr 14, 2020

When I want to make a selectbox in modal to searchable with Select2 it does not work. It looks like disabled, doesn't accept any writing.

resim

The solution is changing the modal contructor prototype by the following code:
$.fn.modal.Constructor.prototype._enforceFocus = function () { };
select2/select2#1436 (comment)
https://select2.org/troubleshooting/common-problems

we should inspect and find possible effects by changing this prototype. If it does not occurs any problem, we can implement this in framework layer.

@cotur cotur added this to the 2.6 milestone Apr 14, 2020
@maliming
Copy link
Member

We can consider adding a js file select2-bootstrap-modal-patch.js.
Add this js to Select2ScriptContributor, if this causes other problems, the developer can remove it.

$.fn.modal.Constructor.prototype._enforceFocus = function () { };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants