Skip to content

Commit

Permalink
fix #788 set to readOnly does not prevent the SwitchButton from trigg…
Browse files Browse the repository at this point in the history
…ering change handlers
  • Loading branch information
vegegoku committed Jun 22, 2023
1 parent be1716f commit 16d7633
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ public SwitchButton() {
inputElement.addEventListener("focus", evt -> inputElement.css("tabbed"));
inputElement.addEventListener("blur", evt -> inputElement.removeCss("tabbed"));

addEventListener(
"click",
evt -> {
if (isReadOnly() || isDisabled()) {
evt.stopPropagation();
evt.preventDefault();
}
});

inputElement.addEventListener(
"change",
evt -> {
Expand Down

0 comments on commit 16d7633

Please sign in to comment.