Render native select out of screen
This closes https://github.com/select2/select2/issues/3065. Signed-off-by: Kevin Brown <kevin@kevinbrown.in>
This commit is contained in:
parent
a993ed9ca9
commit
c24293f2ba
10
dist/css/select2.css
vendored
10
dist/css/select2.css
vendored
@ -112,6 +112,16 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
filter: alpha(opacity=0); }
|
filter: alpha(opacity=0); }
|
||||||
|
|
||||||
|
.select2-hidden-accessible {
|
||||||
|
border: 0;
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 1px; }
|
||||||
|
|
||||||
.select2-container--default .select2-selection--single {
|
.select2-container--default .select2-selection--single {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
|
2
dist/css/select2.min.css
vendored
2
dist/css/select2.min.css
vendored
File diff suppressed because one or more lines are too long
8
dist/js/select2.full.js
vendored
8
dist/js/select2.full.js
vendored
@ -4814,8 +4814,9 @@ S2.define('select2/core',[
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Hide the original select
|
// Hide the original select
|
||||||
$element.hide();
|
$element.addClass('select2-hidden-accessible');
|
||||||
|
$element.attr('aria-hidden', 'true');
|
||||||
|
|
||||||
// Synchronize any monitored attributes
|
// Synchronize any monitored attributes
|
||||||
this._syncAttributes();
|
this._syncAttributes();
|
||||||
|
|
||||||
@ -5226,7 +5227,8 @@ S2.define('select2/core',[
|
|||||||
this.$element.off('.select2');
|
this.$element.off('.select2');
|
||||||
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
||||||
|
|
||||||
this.$element.show();
|
this.$element.removeClass('select2-hidden-accessible');
|
||||||
|
this.$element.attr('aria-hidden', 'false');
|
||||||
this.$element.removeData('select2');
|
this.$element.removeData('select2');
|
||||||
|
|
||||||
this.dataAdapter.destroy();
|
this.dataAdapter.destroy();
|
||||||
|
4
dist/js/select2.full.min.js
vendored
4
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
8
dist/js/select2.js
vendored
8
dist/js/select2.js
vendored
@ -4814,8 +4814,9 @@ S2.define('select2/core',[
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Hide the original select
|
// Hide the original select
|
||||||
$element.hide();
|
$element.addClass('select2-hidden-accessible');
|
||||||
|
$element.attr('aria-hidden', 'true');
|
||||||
|
|
||||||
// Synchronize any monitored attributes
|
// Synchronize any monitored attributes
|
||||||
this._syncAttributes();
|
this._syncAttributes();
|
||||||
|
|
||||||
@ -5226,7 +5227,8 @@ S2.define('select2/core',[
|
|||||||
this.$element.off('.select2');
|
this.$element.off('.select2');
|
||||||
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
||||||
|
|
||||||
this.$element.show();
|
this.$element.removeClass('select2-hidden-accessible');
|
||||||
|
this.$element.attr('aria-hidden', 'false');
|
||||||
this.$element.removeData('select2');
|
this.$element.removeData('select2');
|
||||||
|
|
||||||
this.dataAdapter.destroy();
|
this.dataAdapter.destroy();
|
||||||
|
2
dist/js/select2.min.js
vendored
2
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
8
src/js/select2/core.js
vendored
8
src/js/select2/core.js
vendored
@ -77,8 +77,9 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Hide the original select
|
// Hide the original select
|
||||||
$element.hide();
|
$element.addClass('select2-hidden-accessible');
|
||||||
|
$element.attr('aria-hidden', 'true');
|
||||||
|
|
||||||
// Synchronize any monitored attributes
|
// Synchronize any monitored attributes
|
||||||
this._syncAttributes();
|
this._syncAttributes();
|
||||||
|
|
||||||
@ -489,7 +490,8 @@ define([
|
|||||||
this.$element.off('.select2');
|
this.$element.off('.select2');
|
||||||
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
||||||
|
|
||||||
this.$element.show();
|
this.$element.removeClass('select2-hidden-accessible');
|
||||||
|
this.$element.attr('aria-hidden', 'false');
|
||||||
this.$element.removeData('select2');
|
this.$element.removeData('select2');
|
||||||
|
|
||||||
this.dataAdapter.destroy();
|
this.dataAdapter.destroy();
|
||||||
|
@ -33,5 +33,16 @@
|
|||||||
filter: alpha(opacity=0);
|
filter: alpha(opacity=0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select2-hidden-accessible {
|
||||||
|
border: 0;
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
@import "theme/default/layout";
|
@import "theme/default/layout";
|
||||||
@import "theme/classic/layout";
|
@import "theme/classic/layout";
|
||||||
|
Loading…
Reference in New Issue
Block a user