The `debug` option was chosen because the option also exists in
Select2 4.0.0 and provides similar warnings when configurations
are detected that are known to cause issues in Select2.
Warnings will be displayed in the console if the debug option is
enabled. As there are a lot of options that have been renamed in
Select2 4.0.0, using the older version of the options will trigger
a warning in Select2 3.5.3. Options which were also removed and
have clear migration paths will also trigger a warning with the
link to the relevant documentation.
Options which have been renamed in Select2 4.0.0 are now supported
in Select2 3.5.3, allowing people to migrate their installations
over to the new options before making the final switch.
This closes https://github.com/select2/select2/issues/3483.
If you call element.attr ('style') with Zepto and
there is NO inline style, you get back the
CSS2Properties object. In jQuery you would get
nothing.
To avoid calling split in an object instead of a
string we should check if we really have a string.
Signed-off-by: Leo Unglaub <leo@leo-unglaub.net>
This chrome workaround had the undesired side-effect of preventing anything in the select2 drop from being focused (affected single but not multi selects for some reason). Making the condition more specific to the actual problem being worked around solves this.
This was only done to maintain compatibility with labels, back
when we could capture the focus events from the original element.
Now that we handle them in a different way, this is no longer
needed.
This fixes#2769.
This fixes#2769, where Select2 will jump around because of how
focus moves to the original element when selections are made.
Because absolute positioning pushed the original element out of the
viewport, bringing it back into the viewport should be the best
fix.
Case: the dropdown should be shouwn above input. PositionDropdown function then operates by showing dropdown below (and ".select2-search input" has no margin, it gets the wrong dropdown size). Then in the same function calculates the top value, but doesnt take into account, that input will have the "margin-top: 4px". Thus dropdown is displayed 4px lower.
Then the window resizes, the dropdown position is already correct, but then calculations (outerHeight()) get the height including the ".select2-search input" margin of 4px and thus moves the dropdown up.