From 98ce2593d80991adb7f40f08cda2ef0ed4ebe166 Mon Sep 17 00:00:00 2001 From: Cee Chen <549407+cee-chen@users.noreply.github.com> Date: Thu, 22 Aug 2024 08:51:48 -0700 Subject: [PATCH] [EuiSwitch] Re-add `pointer-events: none` to switch button children (#7974) --- packages/eui/src/components/form/switch/switch.styles.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/eui/src/components/form/switch/switch.styles.ts b/packages/eui/src/components/form/switch/switch.styles.ts index a77dbeaa4e3..73343979621 100644 --- a/packages/eui/src/components/form/switch/switch.styles.ts +++ b/packages/eui/src/components/form/switch/switch.styles.ts @@ -160,6 +160,7 @@ const bodyStyles = ({ colorMode }: UseEuiTheme, { colors }: EuiSwitchVars) => { inset: 0; overflow: hidden; border-radius: inherit; + pointer-events: none; /* Required for Kibana's Selenium driver to be able to click switches in FTR tests */ `, on: css` background-color: ${colors.on}; @@ -242,6 +243,7 @@ const thumbStyles = ({ euiTheme }: UseEuiTheme, switchVars: EuiSwitchVars) => { ${logicalCSS('width', 'fit-content')} ${logicalCSS('height', '100%')} border-radius: 50%; + pointer-events: none; /* Required for Kibana's Selenium driver to be able to click switches in FTR tests */ ${euiCanAnimate} { transition-property: inset-inline-start, transform, background-color,