1
0
mirror of synced 2024-11-22 13:06:08 +03:00
select2/tests/selection
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
..
allowClear-tests.js #4530 Add tooltip (title) to the 'remove all' 'X' icon. (#5291) 2018-09-15 16:22:54 -03:00
containerCss-tests.js Add back *css* options through an adapter 2015-04-05 21:58:02 -04:00
focusing-tests.js Convert source and tests to unix newlines 2019-07-20 23:01:38 -04:00
multiple-tests.js Remove selection title attribute if text is empty (#5589) 2019-07-28 00:36:51 -04:00
placeholder-tests.js Combine tests into common files 2015-02-13 23:29:56 -05:00
search-tests.js Do not propagate click when search box is not empty (#5580) 2019-07-21 13:04:51 -04:00
single-tests.js Remove selection title attribute if text is empty (#5589) 2019-07-28 00:36:51 -04:00
stopPropagation-tests.js Migrate from expect to assert.expect 2016-05-23 23:38:45 -04:00