From af8111063877338fddf32212bed31a7bed3bc2bd Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Thu, 10 Oct 2019 08:55:53 -0500 Subject: [PATCH 1/2] add pointer-events: none to all SVG icons --- src/Nri/Ui/Icon/V3.elm | 5 +++++ src/Nri/Ui/Icon/V4.elm | 5 +++++ src/Nri/Ui/Icon/V5.elm | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/Nri/Ui/Icon/V3.elm b/src/Nri/Ui/Icon/V3.elm index ef6b6716..9bc60814 100644 --- a/src/Nri/Ui/Icon/V3.elm +++ b/src/Nri/Ui/Icon/V3.elm @@ -894,4 +894,9 @@ svgStyle = [ RootAttr.style "fill" "currentColor" , RootAttr.style "width" "100%" , RootAttr.style "height" "100%" + + -- don't allow SVG to capture pointer events. This means that we can use it + -- in links. See https://css-tricks.com/links-inline-svg-staying-target-events/ + -- for more details. + , RootAttr.style "pointer-events" "none" ] diff --git a/src/Nri/Ui/Icon/V4.elm b/src/Nri/Ui/Icon/V4.elm index f9b0214e..8602ee7f 100644 --- a/src/Nri/Ui/Icon/V4.elm +++ b/src/Nri/Ui/Icon/V4.elm @@ -941,4 +941,9 @@ svgStyle = [ RootAttr.style "fill" "currentColor" , RootAttr.style "width" "100%" , RootAttr.style "height" "100%" + + -- don't allow SVG to capture pointer events. This means that we can use it + -- in links. See https://css-tricks.com/links-inline-svg-staying-target-events/ + -- for more details. + , RootAttr.style "pointer-events" "none" ] diff --git a/src/Nri/Ui/Icon/V5.elm b/src/Nri/Ui/Icon/V5.elm index 2016a098..7eb5eaf8 100644 --- a/src/Nri/Ui/Icon/V5.elm +++ b/src/Nri/Ui/Icon/V5.elm @@ -746,4 +746,9 @@ svgStyle = [ RootAttr.style "fill" "currentColor" , RootAttr.style "width" "100%" , RootAttr.style "height" "100%" + + -- don't allow SVG to capture pointer events. This means that we can use it + -- in links. See https://css-tricks.com/links-inline-svg-staying-target-events/ + -- for more details. + , RootAttr.style "pointer-events" "none" ] From 7c73a10b829f067757c6727a2736122af4f458aa Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Thu, 10 Oct 2019 09:03:57 -0500 Subject: [PATCH 2/2] bump to 7.4.1 --- elm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elm.json b/elm.json index 8ef2147f..73c14e96 100644 --- a/elm.json +++ b/elm.json @@ -3,7 +3,7 @@ "name": "NoRedInk/noredink-ui", "summary": "UI Widgets we use at NRI", "license": "BSD-3-Clause", - "version": "7.4.0", + "version": "7.4.1", "exposed-modules": [ "Nri.Ui", "Nri.Ui.Alert.V2",