Use attr
instead of prop
for select2-selection__rendered
title (#4640)
See #3895, and jQuery docs on `attr`: > As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.
This commit is contained in:
parent
a395ad1d75
commit
6ff10680a6
@ -8,7 +8,7 @@
|
||||
|
||||
### Bug fixes
|
||||
- Add `;` before beginning of factory wrapper (#5089)
|
||||
- Clear tooltip from `select2-selection__rendered` when selection is cleared (#4746)
|
||||
- Clear tooltip from `select2-selection__rendered` when selection is cleared (#4640, #4746)
|
||||
- Fix keyboard not closing when closing dropdown on iOS 10 (#4680)
|
||||
- User-defined types not normalized properly when passed in as data (#4632)
|
||||
- Fix "the results could not be loaded" displaying during AJAX request (#4356)
|
||||
|
4
src/js/select2/selection/multiple.js
vendored
4
src/js/select2/selection/multiple.js
vendored
@ -55,7 +55,7 @@ define([
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.clear = function () {
|
||||
this.$selection.find('.select2-selection__rendered').empty();
|
||||
this.$selection.find('.select2-selection__rendered').empty().removeAttr('title');
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.display = function (data, container) {
|
||||
@ -93,7 +93,7 @@ define([
|
||||
var formatted = this.display(selection, $selection);
|
||||
|
||||
$selection.append(formatted);
|
||||
$selection.prop('title', selection.title || selection.text);
|
||||
$selection.attr('title', selection.title || selection.text);
|
||||
|
||||
$selection.data('data', selection);
|
||||
|
||||
|
5
src/js/select2/selection/single.js
vendored
5
src/js/select2/selection/single.js
vendored
@ -66,10 +66,9 @@ define([
|
||||
};
|
||||
|
||||
SingleSelection.prototype.clear = function () {
|
||||
|
||||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
$rendered.empty();
|
||||
$rendered.attr('title',''); // clear tooltip on empty
|
||||
$rendered.removeAttr('title'); // clear tooltip on empty
|
||||
};
|
||||
|
||||
SingleSelection.prototype.display = function (data, container) {
|
||||
@ -95,7 +94,7 @@ define([
|
||||
var formatted = this.display(selection, $rendered);
|
||||
|
||||
$rendered.empty().append(formatted);
|
||||
$rendered.prop('title', selection.title || selection.text);
|
||||
$rendered.attr('title', selection.title || selection.text);
|
||||
};
|
||||
|
||||
return SingleSelection;
|
||||
|
Loading…
Reference in New Issue
Block a user