abp icon indicating copy to clipboard operation
abp copied to clipboard

Select2 is not working in opened modal by default

Open cotur opened this issue 6 years ago • 1 comments

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 () { }; https://github.com/select2/select2/issues/1436#issuecomment-21028474 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 avatar Apr 14 '20 14:04 cotur

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 () { };

maliming avatar Apr 15 '20 00:04 maliming