Skip to content

feat(ios): add onLinkLongPress handler - #649

Merged
maksg merged 1 commit into
mainfrom
ios-parity/03-link-long-press
Aug 13, 2026
Merged

feat(ios): add onLinkLongPress handler#649
maksg merged 1 commit into
mainfrom
ios-parity/03-link-long-press

Conversation

@maksg

@maksg maksg commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Adds an .onLinkLongPress(_:) environment modifier matching the Android package's onLinkLongPress callback. Link interactions route through the UITextViewDelegate on both generations: the legacy shouldInteractWith path (iOS 15-16) switches on the interaction type, and the iOS 17 UITextItem methods return a primary action for taps and suppress the system link menu when a long-press handler consumes the gesture.

With only a press handler set, a long-press keeps the pre-existing behavior of firing the press and suppressing the menu.

What/Why?

Testing

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Base automatically changed from ios-parity/02-selectable-selection-color to main August 13, 2026 10:13
Adds an .onLinkLongPress(_:) environment modifier matching the Android
package's onLinkLongPress callback. Link interactions route through the
UITextViewDelegate on both generations: the legacy shouldInteractWith
path (iOS 15-16) switches on the interaction type, and the iOS 17
UITextItem methods return a primary action for taps and suppress the
system link menu when a long-press handler consumes the gesture.

With only a press handler set, a long-press keeps the pre-existing
behavior of firing the press and suppressing the menu.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@maksg
maksg force-pushed the ios-parity/03-link-long-press branch from 0662811 to 11f8bf2 Compare August 13, 2026 10:21
@maksg
maksg merged commit 5eff168 into main Aug 13, 2026
9 checks passed
@maksg
maksg deleted the ios-parity/03-link-long-press branch August 13, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants