Skip to content

Commit

Permalink
fix: wallet icons selectable on connect modal (iOS) (#1726)
Browse files Browse the repository at this point in the history
* fix: ios selection bug

* chore: apply -webkit only to ios

* chore: changeset

* chore: tweak changeset

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>
  • Loading branch information
magiziz and DanielSinclair committed Jan 31, 2024
1 parent 7fbe6f8 commit a79609b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-moons-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Fixed a bug that allowed users to hold-press or cursor select wallet icons on iOS, which interrupted the connection experiencce.
3 changes: 3 additions & 0 deletions packages/rainbowkit/src/components/AsyncImage/AsyncImage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useReducer } from 'react';
import { isIOS } from '../../utils/isMobile';
import { Box, BoxProps } from '../Box/Box';
import { AsyncImageSrc, useAsyncImage } from './useAsyncImage';

Expand Down Expand Up @@ -28,6 +29,7 @@ export function AsyncImage({
width,
testId,
}: AsyncImageProps) {
const ios = isIOS();
const src = useAsyncImage(srcProp);
const isRemoteImage = src && /^http/.test(src);
const [isRemoteImageLoaded, setRemoteImageLoaded] = useReducer(
Expand Down Expand Up @@ -66,6 +68,7 @@ export function AsyncImage({
})}
height="full"
position="absolute"
{...(ios ? { WebkitUserSelect: 'none' } : {})}
style={{
touchCallout: 'none',
transition: 'opacity .15s linear',
Expand Down
1 change: 1 addition & 0 deletions packages/rainbowkit/src/css/sprinkles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const unresponsiveProperties = defineProperties({
paddingRight: spacing,
paddingTop: spacing,
position: ['absolute', 'fixed', 'relative'],
WebkitUserSelect: ['none'],
right: {
'0': '0',
},
Expand Down

0 comments on commit a79609b

Please sign in to comment.