From cc5d6456b80892ae948c836244afb887ac52818e Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 26 Jan 2016 08:40:43 -0400 Subject: [PATCH] Prevent click events on disable buttons For some reasons, despite being disabled, buttons still call the action defined as `ngClick`. In the case of the burn progress button, this results in: ```sh TypeError: Cannot read property 'device' of undefined ``` Fixes: https://github.com/resin-io/etcher/issues/132 --- build/css/main.css | 3 ++- lib/scss/main.scss | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/css/main.css b/build/css/main.css index fe78759c..d0bd91bf 100644 --- a/build/css/main.css +++ b/build/css/main.css @@ -5877,7 +5877,8 @@ hero-icon[disabled] hero-caption { hero-button .btn[disabled] { background-color: #313339; - color: #787c7f; } + color: #787c7f; + pointer-events: none; } hero-button .btn[disabled]:hover { background-color: #36383e; } diff --git a/lib/scss/main.scss b/lib/scss/main.scss index a60bed51..ef37a087 100644 --- a/lib/scss/main.scss +++ b/lib/scss/main.scss @@ -52,6 +52,7 @@ hero-button .btn { &[disabled] { background-color: $btn-disabled; color: $color-disabled; + pointer-events: none; &:hover { background-color: lighten($btn-disabled, 2);