Skip to content

Commit

Permalink
Fix not clickable button with svg in Safari (#1985)
Browse files Browse the repository at this point in the history
* Fix not clickable button with svg in Safari

* Update changelog
  • Loading branch information
maryia-lapata authored and thompsongl committed Jun 3, 2019
1 parent 771830d commit 5e2a5fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Fixed type mismatch between PropType and TypeScript def for `EuiGlobalToastList` toast `title` ([#1978](https://github.com/elastic/eui/pull/1978))
- Fixed missing Typescript definition for `EuiButton`'s `color="text"` option ([#1980](https://github.com/elastic/eui/pull/1980))
- Fixed Prettier formatting lint error in `EuiTable` TS def file ([#1986](https://github.com/elastic/eui/pull/1986))
- Fixed not clickable button with svg in Safari ([#1985](https://github.com/elastic/eui/pull/1985))

## [`11.2.1`](https://github.com/elastic/eui/tree/v11.2.1)

Expand Down
6 changes: 6 additions & 0 deletions src/components/button/button_icon/_button_icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
padding: $euiSizeXS;
border-radius: $euiBorderRadius;

& > svg {
// prevents the element and its children from receiving any pointer events to fix not bubbling click event in Safari
// https://stackoverflow.com/questions/24078524/svg-click-events-not-firing-bubbling-when-using-use-element
pointer-events: none;
}

&:disabled {
color: $euiButtonColorDisabled;
pointer-events: none;
Expand Down

0 comments on commit 5e2a5fa

Please sign in to comment.