Skip to content

[Bug] Android: applying a bold heading strips bold from the previous line #671

Description

@lukasz-patalan

Describe the bug

On Android, applying a bold heading (htmlStyle.h1.bold: true) to an empty line removes bold from the previous line. Turning a new empty line into a heading unexpectedly strips the bold formatting from the line above it.

To Reproduce

Steps to reproduce the behavior (Android):

  1. Render EnrichedTextInput with htmlStyle={{ h1: { bold: true }, h2: { bold: true } }}.
  2. Type some text and make it bold - this is line A.
  3. Press Enter to move to a new empty line.
  4. Select the H1 (or H2)
  5. See error: line A loses its bold, while the new line correctly becomes a heading.

Expected behavior

Applying a heading on the new/empty line should only affect previous line- it must keep its bold formatting. Removing a conflicting inline style should be scoped to the requested range ([start, end]) and preserve the parts of the span that fall outside it.

Video

Untitled.mp4

Device:

  • Device: Galaxy A70 (reproduced on physical device)
  • OS: Android 11
  • Version: react-native-enriched-html 1.0.0

Additional context

  • Platform-specific: happens on Android only. iOS is unaffected - toggling a heading there never strips bold from adjacent lines.
  • Only reproduces when the heading is configured as bold (htmlStyle.h1.bold: true / h2.bold: true).

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions