Skip to content

Commit 3767ba8

Browse files
authored
fix(dropdown): reuse select tabindex
Reuse existing tabindex from select tag when transforming into dropdown. Even worse, an existing tabindex for a select would have inpact on tabbing even though the original select is hidden when transformed into a dropdown.
1 parent 7071e59 commit 3767ba8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/definitions/modules/dropdown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ $.fn.dropdown = function(parameters) {
428428
if($input.is('[required]')) {
429429
settings.forceSelection = true;
430430
}
431+
if(!settings.allowTab) {
432+
$input.removeAttr('tabindex');
433+
}
431434
$input
432435
.prop('required',false)
433436
.removeAttr('class')
@@ -2507,13 +2510,14 @@ $.fn.dropdown = function(parameters) {
25072510
module.debug('Added tabindex to dropdown');
25082511
if( $module.attr('tabindex') === undefined) {
25092512
$module
2510-
.attr('tabindex', 0)
2513+
.attr('tabindex', $input.attr('tabindex') || 0)
25112514
;
25122515
$menu
25132516
.attr('tabindex', -1)
25142517
;
25152518
}
25162519
}
2520+
$input.removeAttr('tabindex');
25172521
},
25182522
initialLoad: function() {
25192523
module.verbose('Setting initial load');

0 commit comments

Comments
 (0)