feat(web): EnrichedText selectable, useHtmlNormalizer, ref, onFocus, onBlur#677
Open
hejsztynx wants to merge 4 commits into
Open
feat(web): EnrichedText selectable, useHtmlNormalizer, ref, onFocus, onBlur#677hejsztynx wants to merge 4 commits into
hejsztynx wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the web implementation of <EnrichedText /> to better match the React Native API surface by adding selection control, optional HTML normalization, and an imperative instance handle with focus/blur support, plus focus/blur callbacks. It also updates the documentation to reflect the new web support and refactors the example web app to demonstrate the new capabilities.
Changes:
- Add web support for
selectableanduseHtmlNormalizerin<EnrichedText />. - Introduce an exported
EnrichedTextInstancetype and implement (mostly no-op) imperativerefmethods on web, with functionalfocus()/blur(). - Refactor the example web app to showcase focus/blur via ref and the HTML normalizer.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/styleConversion/enrichedThemingToCSSProperties.ts | Adds shared theming helpers and new enrichedTextThemingToCSSProperties (selection color + selectable/userSelect). |
| src/web/normalization/prepareHtmlForWeb.ts | Adds optional normalization (useHtmlNormalizer) before web-specific checkbox conversion. |
| src/web/EnrichedText.tsx | Wires up selectable, useHtmlNormalizer, focus/blur handlers, and an imperative instance API on web. |
| src/index.tsx | Exports EnrichedTextInstance from the public API. |
| docs/WEB.md | Updates web capability list and documents ref layout methods as no-ops on web. |
| docs/TEXT_API_REFERENCE.md | Updates platform tables to include Web for useHtmlNormalizer and selectable. |
| apps/example-web/src/components/TextRenderer.tsx | New example component demonstrating ref focus/blur + focus/blur events + html normalizer usage. |
| apps/example-web/src/components/TextActions.tsx | Adds shared focus/blur button UI for the example app. |
| apps/example-web/src/components/EditorActions.tsx | Switches to shared Actions.css. |
| apps/example-web/src/components/Actions.css | Adds shared action layout/button row styling. |
| apps/example-web/src/App.tsx | Refactors to use TextRenderer for enriched text rendering. |
Comments suppressed due to low confidence (1)
src/web/EnrichedText.tsx:123
- After wrapping the component with
forwardRef, the closing parentheses need to match the new nesting (memo(forwardRef(...))). Otherwise this won’t compile.
</>
);
}
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
exploIF
approved these changes
Jul 6, 2026
szydlovsky
reviewed
Jul 7, 2026
szydlovsky
left a comment
Collaborator
There was a problem hiding this comment.
In general nice, but I have a few uncertainties
kacperzolkiewski
approved these changes
Jul 8, 2026
szydlovsky
approved these changes
Jul 8, 2026
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
Implemented following props:
selectableuseHtmlNormalizerrefmethods, where onlyfocusandblurare functional, the rest of them are no-oponFocusandonBlurcallback propsAdded
EnrichedTextInstanceto the exported API. Refactored the web example app.Compatibility
Checklist