1
0
mirror of synced 2024-11-25 06:16:08 +03:00
select2/tests
Kevin Brown efbfd14414
Remove selection title attribute if text is empty (#5589)
This fixes a bug that was introduced in Select2 4.0.0 and only
partially fixed in Select2 4.0.6-rc.0 where the `title` attribute
that is set on the selection container (or individual selections,
for a multiple select) is not cleared when the text/title of the
option is not set. In most cases, users no longer see this issue
because the `text` property of most data objects is set, so the
`title` attribute will always be cleared correctly. There was a bug
for cases where the `text` property was not set, or where the `text`
property was set to an empty string, that resulted in the `title`
attribute persisting with the incorrect value.

We have fixed this issue by always removing the `title` attribute
from the selection (or not adding it in the first place, for a
multiple select) when the `text` and `title` properties of the data
object are empty or not present.

This also adds in a series of tests to ensure the `title` attribute
is set properly in a variety of cases, building upon the ones that
already existed.

Fixes #3895
2019-07-28 00:36:51 -04:00
..
a11y Mirror disabled state through aria-disabled on selection (#5579) 2019-07-21 11:44:09 -04:00
data Fix generated options not receiving result IDs (#5586) 2019-07-27 16:37:57 -04:00
dropdown Test against jQuery 3.4.1 (#5531) 2019-06-25 22:05:15 -04:00
integration Fix tag creation being broken in 4.0.7 (#5558) 2019-07-09 19:13:03 -04:00
options Add computedstyle option for calculating the width (#5559) 2019-07-09 19:44:33 -04:00
results Convert source and tests to unix newlines 2019-07-20 23:01:38 -04:00
selection Remove selection title attribute if text is empty (#5589) 2019-07-28 00:36:51 -04:00
utils Select2 now clears the internal ID when it is destroyed (#5587) 2019-07-27 21:37:43 -04:00
vendor Test against jQuery 3.4.1 (#5531) 2019-06-25 22:05:15 -04:00
helpers.js Update grunt-contrib-qunit to latest version (#5530) 2019-06-04 22:43:52 -04:00
integration-jq1.html Restore compatibility with data-* attributes in jQuery 2.x (#5486) 2019-04-27 22:20:56 -04:00
integration-jq2.html Restore compatibility with data-* attributes in jQuery 2.x (#5486) 2019-04-27 22:20:56 -04:00
integration-jq3.html Test against jQuery 3.4.1 (#5531) 2019-06-25 22:05:15 -04:00
unit-jq1.html Select2 now clears the internal ID when it is destroyed (#5587) 2019-07-27 21:37:43 -04:00
unit-jq2.html Select2 now clears the internal ID when it is destroyed (#5587) 2019-07-27 21:37:43 -04:00
unit-jq3.html Select2 now clears the internal ID when it is destroyed (#5587) 2019-07-27 21:37:43 -04:00