Skip to content

Commit

Permalink
[Button, Link] Add touch action property (#11845)
Browse files Browse the repository at this point in the history
Micro optimization: removes the browser delay in waiting for a potential
double tap.


https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#manipulation
  • Loading branch information
kyledurand committed Apr 5, 2024
1 parent 937c618 commit 8145d73
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-ears-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Added `touch-action: manipulation` to `Button` and `Link`
1 change: 1 addition & 0 deletions polaris-react/src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
color: var(--pc-button-color);
cursor: pointer;
user-select: none;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
}

Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/Link/Link.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
color: var(--p-color-text-link);
text-decoration: underline;
cursor: pointer;
touch-action: manipulation;

&:hover {
color: var(--p-color-text-link-hover);
Expand Down

0 comments on commit 8145d73

Please sign in to comment.