chore: useHtmlNormalizer enabled by default#684
Open
szydlovsky wants to merge 2 commits into
Open
Conversation
szydlovsky
commented
Jul 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR switches useHtmlNormalizer to be enabled by default across the library, and updates web rendering/theming plus documentation and example apps to reflect the new default and newly-supported web behaviors.
Changes:
- Enable
useHtmlNormalizerby default forEnrichedTextInputandEnrichedText(native + web) and propagate it into web HTML preparation. - Improve web
EnrichedTexttheming to respectselectableandselectionColor, and add focus/blur handling. - Update docs and examples to align with the new defaults and supported web props.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/styleConversion/enrichedThemingToCSSProperties.ts | Adds shared selection-color application and introduces enrichedTextThemingToCSSProperties (incl. userSelect). |
| src/web/normalization/prepareHtmlForWeb.ts | Adds optional HTML normalization step before web-specific checkbox adaptation. |
| src/web/EnrichedTextInput.tsx | Defaults useHtmlNormalizer from updated library defaults. |
| src/web/EnrichedText.tsx | Defaults useHtmlNormalizer to true, adds selectable theming + focus/blur wiring and an imperative handle attempt. |
| src/utils/EnrichedTextInputDefaultProps.ts | Flips default useHtmlNormalizer to true. |
| src/types.ts | Updates JSDoc to state useHtmlNormalizer is enabled by default. |
| src/native/EnrichedText.tsx | Flips default useHtmlNormalizer to true. |
| src/index.tsx | Exports EnrichedTextInstance type from the web entry point. |
| docs/WEB.md | Updates web support matrix (now supports selectable and useHtmlNormalizer; notes ref methods are no-ops). |
| docs/TEXT_API_REFERENCE.md | Updates platform/default tables for useHtmlNormalizer and selectable (now includes web, new default). |
| docs/INPUT_API_REFERENCE.md | Updates useHtmlNormalizer documentation/default; minor docs tweak in shortcuts section. |
| apps/example/src/screens/TestScreen.tsx | Removes explicit useHtmlNormalizer prop usage (now default). |
| apps/example/src/screens/EnrichedTextScreen.tsx | Removes explicit useHtmlNormalizer prop usage (now default). |
| apps/example/src/screens/DevScreen.tsx | Removes explicit useHtmlNormalizer prop usage (now default). |
| apps/example/src/components/TextRenderer.tsx | Removes explicit useHtmlNormalizer prop usage (now default). |
| apps/example-web/src/components/TextRenderer.tsx | Adds a web demo of EnrichedText with ref-driven focus/blur buttons. |
| apps/example-web/src/components/TextActions.tsx | Adds a small button-row component for text focus/blur actions. |
| apps/example-web/src/components/EditorActions.tsx | Switches styling import to shared Actions.css. |
| apps/example-web/src/components/Actions.css | Adds shared layout styles for action containers/button rows. |
| apps/example-web/src/App.tsx | Refactors web example to use the new TextRenderer and removes explicit useHtmlNormalizer. |
Comments suppressed due to low confidence (1)
src/web/EnrichedText.tsx:29
EnrichedTextis wrapped inmemoand destructuresreffrom props. In React,refis not passed as a normal prop (andmemocomponents don’t accept refs unless the inner component isforwardRef), souseImperativeHandle(ref, …)will never attach andref.current?.focus()/blur()won’t work (as used in the web example). Consider converting this component toforwardRef(optionally wrapped withmemo) and using the forwarded ref argument; update the public types/docs accordingly sorefis an actual React ref, not a prop.
export const EnrichedText = memo(
({
ref,
children,
htmlStyle,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| scrollEnabled: true, | ||
| androidExperimentalSynchronousEvents: false, | ||
| useHtmlNormalizer: false, | ||
| useHtmlNormalizer: true, |
Collaborator
There was a problem hiding this comment.
Good catch, worth checking it out before we enable it by default
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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
This PR makes
useHtmlNormalizerenabled by default.As it's an expected behaviour from our library to always try normalizing any outside HTML, we feel it's high time this prop became enabled from the get-go.
Also updated JSDocs, docs and example app components.
Test Plan
Screenshots / Videos
Compatibility
Checklist