Fix dropdown positioning when displayed above with messages (#5592)
This fixes an issue which was usually observed when working with AJAX results sets and having a message being displayed, usually the minimum characters message or an error. The dropdown would display up, like it was supposed to, but the message would appear to be floating above the container and detached. This was occuring because the dropdown position was not being calculated whenever a message was displayed in the results, only when the results were loaded or new results were appended to an existing results set. There are plenty of situations where this could have caused issues, but somehow most of the reports were around a very specific situation with AJAX which could be reproduced on the examples site. Fixes #4614 Fixes #4616 Fixes #5253 Closes #5196
This commit is contained in:
parent
525f661915
commit
472e5ad50f
5
src/js/select2/dropdown/attachBody.js
vendored
5
src/js/select2/dropdown/attachBody.js
vendored
@ -33,6 +33,11 @@ define([
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('results:message', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('select', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
|
Loading…
Reference in New Issue
Block a user