[yew-devel] [PATCH yew-widget-toolkit-assets] disable pointer events for disabled inputs

Dominik Csapak d.csapak at proxmox.com
Thu May 22 10:52:54 CEST 2025


when an input is disabled, we should prevent all pointer events,
otherwise it can happen that the browser decides an element has focus
and will show an outline, which is not desired for mouse input on
disabled fields (only for keyboard navigation, but this is unaffected
with this change)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 scss/_input.scss | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scss/_input.scss b/scss/_input.scss
index 5113fdd..b8ad81a 100644
--- a/scss/_input.scss
+++ b/scss/_input.scss
@@ -86,6 +86,7 @@ input {
     &[aria-disabled=true]{
         cursor: auto;
         opacity: 0.5;
+        pointer-events: none;
     }
 }
 
@@ -177,6 +178,7 @@ input {
     &.disabled {
         cursor: auto;
         opacity: 0.5;
+        pointer-events: none;
     }
 }
 
@@ -230,6 +232,7 @@ input {
     &.disabled {
         cursor: auto;
         opacity: 0.5;
+        pointer-events: none;
     }
 
     &.disabled.checked {
@@ -311,6 +314,7 @@ input {
     &:disabled {
         cursor: auto;
         opacity: 0.5;
+        pointer-events: none;
     }
 }
 
-- 
2.39.5





More information about the yew-devel mailing list