Skip to content

Commit e3d7cd2

Browse files
committed
Fixed allowClear on fixed width
This moves the clear icon to the top of the DOM from the bottom to ensure that it is always visible on top of the selection. This closes select2#3089.
1 parent 78c301f commit e3d7cd2

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

dist/js/select2.amd.full.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ define('select2/selection/allowClear',[
12261226
);
12271227
$remove.data('data', data);
12281228

1229-
this.$selection.find('.select2-selection__rendered').append($remove);
1229+
this.$selection.find('.select2-selection__rendered').prepend($remove);
12301230
};
12311231

12321232
return AllowClear;

dist/js/select2.amd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ define('select2/selection/allowClear',[
12261226
);
12271227
$remove.data('data', data);
12281228

1229-
this.$selection.find('.select2-selection__rendered').append($remove);
1229+
this.$selection.find('.select2-selection__rendered').prepend($remove);
12301230
};
12311231

12321232
return AllowClear;

dist/js/select2.full.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 00:39:48 GMT
2+
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 01:27:38 GMT
33
* https://select2.github.io
44
*
55
* Released under the MIT license
@@ -1672,7 +1672,7 @@ define('select2/selection/allowClear',[
16721672
);
16731673
$remove.data('data', data);
16741674

1675-
this.$selection.find('.select2-selection__rendered').append($remove);
1675+
this.$selection.find('.select2-selection__rendered').prepend($remove);
16761676
};
16771677

16781678
return AllowClear;

dist/js/select2.full.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/select2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 00:39:48 GMT
2+
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 01:27:38 GMT
33
* https://select2.github.io
44
*
55
* Released under the MIT license
@@ -1672,7 +1672,7 @@ define('select2/selection/allowClear',[
16721672
);
16731673
$remove.data('data', data);
16741674

1675-
this.$selection.find('.select2-selection__rendered').append($remove);
1675+
this.$selection.find('.select2-selection__rendered').prepend($remove);
16761676
};
16771677

16781678
return AllowClear;

dist/js/select2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/select2/selection/allowClear.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ define([
6464
);
6565
$remove.data('data', data);
6666

67-
this.$selection.find('.select2-selection__rendered').append($remove);
67+
this.$selection.find('.select2-selection__rendered').prepend($remove);
6868
};
6969

7070
return AllowClear;

0 commit comments

Comments
 (0)