Skip to content

Commit

Permalink
fix(slider): also bind events on disabled variant
Browse files Browse the repository at this point in the history
Always bind events even if the initial slider is disabled. This allows to keep the slider intact if the disabled class is removed manually
  • Loading branch information
lubber-de committed Mar 2, 2023
1 parent e275dcb commit cb680cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/definitions/modules/slider.js
Expand Up @@ -103,9 +103,7 @@
module.setup.layout();
module.setup.labels();

if (!module.is.disabled()) {
module.bind.events();
}
module.bind.events();

module.read.metadata();
module.read.settings();
Expand Down Expand Up @@ -401,6 +399,9 @@
}
},
keydown: function (event, first) {
if (module.is.disabled()) {
return;
}
if (settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
$currThumb = undefined;
}
Expand Down Expand Up @@ -437,7 +438,7 @@
}
},
activateFocus: function (event) {
if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
if (!module.is.disabled() && !module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
event.preventDefault();
module.event.keydown(event, true);
$module.trigger('focus');
Expand Down

0 comments on commit cb680cb

Please sign in to comment.