You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On web, EnrichedLink hardcodes openOnClick: false, so links inside EnrichedTextInput can never be followed. onLinkPress exists only on EnrichedText, and onLinkDetected only reports caret position — neither
gives an editor a way to open a link.
Our users write documents in an always-editable editor and report the links
as broken, because on the web a link that does nothing when clicked reads as
a bug. We currently work around it with a document-level capture click
listener that finds the anchor and calls window.open — brittle, and it
fights the library rather than using it.
Proposed solution
An opt-in prop on EnrichedTextInput for web, defaulting to today's
behaviour so nothing changes for existing users. Either:
onLinkPress?: (e: { url: string }) => void — same shape as EnrichedText, letting the app decide what to do; or
openLinksOnClick?: boolean — forwarded to the Link extension's openOnClick.
We'd prefer onLinkPress for symmetry with EnrichedText.
Alternatives considered
onLinkDetected + a custom link bubble. Workable, but it's a lot of UI to
build for "open this link", and it only fires on caret entry, not on click.
Forking or patching the extension to flip openOnClick.
Our current document capture listener, which is what we ship today.
Additional context
We understand the current behaviour is deliberate and cross-platform: a
native text input can't both place the caret and follow a link on one tap,
and onLinkPress was removed from the Android input in #60. This request is
scoped to web only, where a mouse can distinguish a click on a link from a
click to place the caret, and where users have strong expectations about
links being clickable.
Hi @henrikra !
We really liked the idea and decided it's worth implementing. The feature is still under development in #795 , but you can expect it available in the future release. Thanks a lot!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
On web,
EnrichedLinkhardcodesopenOnClick: false, so links insideEnrichedTextInputcan never be followed.onLinkPressexists only onEnrichedText, andonLinkDetectedonly reports caret position — neithergives an editor a way to open a link.
Our users write documents in an always-editable editor and report the links
as broken, because on the web a link that does nothing when clicked reads as
a bug. We currently work around it with a
document-level capture clicklistener that finds the anchor and calls
window.open— brittle, and itfights the library rather than using it.
Proposed solution
An opt-in prop on
EnrichedTextInputfor web, defaulting to today'sbehaviour so nothing changes for existing users. Either:
onLinkPress?: (e: { url: string }) => void— same shape asEnrichedText, letting the app decide what to do; oropenLinksOnClick?: boolean— forwarded to the Link extension'sopenOnClick.We'd prefer
onLinkPressfor symmetry withEnrichedText.Alternatives considered
onLinkDetected+ a custom link bubble. Workable, but it's a lot of UI tobuild for "open this link", and it only fires on caret entry, not on click.
openOnClick.documentcapture listener, which is what we ship today.Additional context
We understand the current behaviour is deliberate and cross-platform: a
native text input can't both place the caret and follow a link on one tap,
and
onLinkPresswas removed from the Android input in #60. This request isscoped to web only, where a mouse can distinguish a click on a link from a
click to place the caret, and where users have strong expectations about
links being clickable.
react-native-enriched-html 1.1.1
All reactions