Skip to content

Commit

Permalink
fix(dropdown): reuse select tabindex
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lubber-de authored Dec 2, 2022
1 parent 7071e59 commit 3767ba8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ $.fn.dropdown = function(parameters) {
if($input.is('[required]')) {
settings.forceSelection = true;
}
if(!settings.allowTab) {
$input.removeAttr('tabindex');
}
$input
.prop('required',false)
.removeAttr('class')
Expand Down Expand Up @@ -2507,13 +2510,14 @@ $.fn.dropdown = function(parameters) {
module.debug('Added tabindex to dropdown');
if( $module.attr('tabindex') === undefined) {
$module
.attr('tabindex', 0)
.attr('tabindex', $input.attr('tabindex') || 0)
;
$menu
.attr('tabindex', -1)
;
}
}
$input.removeAttr('tabindex');
},
initialLoad: function() {
module.verbose('Setting initial load');
Expand Down

0 comments on commit 3767ba8

Please sign in to comment.