Skip to content

chore: useHtmlNormalizer enabled by default#684

Open
szydlovsky wants to merge 2 commits into
@ksienkiewicz/feat-web-enriched-text-rest-of-basic-propsfrom
@szydlovsky/useHtmlNormalizer-enabled-by-default
Open

chore: useHtmlNormalizer enabled by default#684
szydlovsky wants to merge 2 commits into
@ksienkiewicz/feat-web-enriched-text-rest-of-basic-propsfrom
@szydlovsky/useHtmlNormalizer-enabled-by-default

Conversation

@szydlovsky

@szydlovsky szydlovsky commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR makes useHtmlNormalizer enabled 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

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

@szydlovsky szydlovsky changed the base branch from main to @ksienkiewicz/feat-web-enriched-text-rest-of-basic-props July 7, 2026 17:07
Comment thread docs/INPUT_API_REFERENCE.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 useHtmlNormalizer by default for EnrichedTextInput and EnrichedText (native + web) and propagate it into web HTML preparation.
  • Improve web EnrichedText theming to respect selectable and selectionColor, 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

  • EnrichedText is wrapped in memo and destructures ref from props. In React, ref is not passed as a normal prop (and memo components don’t accept refs unless the inner component is forwardRef), so useImperativeHandle(ref, …) will never attach and ref.current?.focus()/blur() won’t work (as used in the web example). Consider converting this component to forwardRef (optionally wrapped with memo) and using the forwarded ref argument; update the public types/docs accordingly so ref is 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,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, worth checking it out before we enable it by default

Comment thread docs/INPUT_API_REFERENCE.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants