Skip to content

Commit

Permalink
fix(modal): autofocus shouldn’t focus disabled inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de authored and Sean committed Apr 30, 2019
1 parent f03c4ec commit fadbc30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,9 @@ $.fn.modal = function(parameters) {
set: {
autofocus: function() {
var
$inputs = $module.find('[tabindex], :input').filter(':visible'),
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
return $(this).closest('.disabled').length === 0;
}),
$autofocus = $inputs.filter('[autofocus]'),
$input = ($autofocus.length > 0)
? $autofocus.first()
Expand Down

0 comments on commit fadbc30

Please sign in to comment.