Skip to content

Commit db2aa80

Browse files
feat(link): disable long press behavior in iOS (#533)
1 parent bc32f3b commit db2aa80

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.changeset/pink-weeks-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@stackflow/link": minor
3+
---
4+
5+
feat(link): disable long press behavior in iOS

extensions/link/src/future/Link.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ export function Link<K extends RegisteredActivityName>(props: LinkProps<K>) {
100100
};
101101

102102
return (
103-
<a ref={props.ref} href={href} onClick={onClick} {...anchorProps}>
103+
<a
104+
ref={props.ref}
105+
href={href}
106+
onClick={onClick}
107+
draggable="false" // Disable long press behavior by default in iOS
108+
{...anchorProps}
109+
>
104110
{props.children}
105111
</a>
106112
);

extensions/link/src/stable/Link.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export const Link: TypeLink = forwardRef(
134134
ref={mergeRefs(ref, anchorRef)}
135135
href={href}
136136
onClick={onClick}
137+
draggable="false" // Disable long press behavior by default in iOS
137138
{...anchorProps}
138139
>
139140
{props.children}

0 commit comments

Comments
 (0)