chore/visibility - #13
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the package work in Expo Go and Snack, rewrites the metadata that npm and
search engines index, documents the selection-menu recipe people keep asking
for, and cuts 1.1.0.
src/SelectableTextModule.tsresolved the native module withrequireNativeModuleat import time, only to expose aversionconstant thatnothing reads. In Expo Go that module is not in the binary, so importing the
package threw — even though
react-native-webview, the thing the view actuallyneeds, ships inside Expo Go. It now resolves with
requireOptionalNativeModule.The native module stays, so we can patch the WebView natively later; the default
export is simply
nullwhere it is absent.The rest is metadata and docs:
and no longer promises "custom menus", which the module does not ship.
(
serialization,synchronization,restoration,native module) in favourof how people describe the problem:
highlighter,annotation,ebook,reader,notes,bookmark.webViewProps.menuItemsandonCustomMenuSelectionreachreact-native-webviewuntouched, so the nativemenu can drive the ref's highlight methods.
example/src/screens/Reader.tsxalready wires exactly this, so the section points at working code.
as explicit about what this is not for (native
<Text>, web, PDF) as what itis for.
four places the supported
react-native-webviewrange is duplicated, and thenine places the vendored
rangy@1.3.2directory name appears.Type of change
fix— bug fix (no public API change)feat— new backward-compatible APIdocs/chore/ci/test— no runtime changeThe default export's type widens from the module to
Module | null, which iswhy this is 1.1.0 and not 1.0.1. Anyone reading
.versionoff it now needs anull check; nothing else in the public surface moves.
How was this tested?
yarn lint,yarn typecheckandyarn test(151 tests) pass.On device, through a throwaway app outside this repo that installs the library
from
npm pack— a real copy of what would be published, not a path link:nullnullThe bare runs came from
npx expo prebuild, which autolinked the podMajornutcrackerReactNativeSelectableTextfrom the tarball; Gradle and Xcodebuilt with no further setup.
On Android the whole loop was exercised: long-press selects, the menu shows only
our items, applying one paints the highlight and emits the serialized payload,
remount drops the WebView (captured mid-reload, blank), and restore repaints it
from the saved payload.
The
—cells are the touch half on iOS only: the simulator takes no input fromthe CLI without accessibility permission. iOS rendering and the
nullmodulewere verified; iOS selection behaviour is unchanged by this PR and is what the
example app's GIFs already show.
Checklist
yarn lint,yarn typecheck, andyarn testall pass.changelog and in a comment at the call site. It is not in the README prop
table, which covers props rather than the module export.
CHANGELOG.mdupdated under## [Unreleased]— deliberately not: this PRcuts the release, so the entries sit under
## [1.1.0] - 2026-09-23with afresh empty
## [Unreleased]above.bump: v1.1.0syncs all six places
docs/VERSION-UPDATE.mdlists (versionCode1 → 2)per its release flow, which commits the bump, merges to
main, and thentags. Merging this arms
git tag v1.1.0, which publishes to npm.