Skip to content

feat: add paragraphSpacing to checkbox list (iOS + Android)#470

Open
ErionTp wants to merge 1 commit intosoftware-mansion:mainfrom
ErionTp:feat/checkbox-paragraph-spacing
Open

feat: add paragraphSpacing to checkbox list (iOS + Android)#470
ErionTp wants to merge 1 commit intosoftware-mansion:mainfrom
ErionTp:feat/checkbox-paragraph-spacing

Conversation

@ErionTp
Copy link

@ErionTp ErionTp commented Mar 8, 2026

Summary

  • Adds a paragraphSpacing property to ulCheckbox in HtmlStyle to control vertical spacing between checkbox list items
  • iOS: Uses NSMutableParagraphStyle.paragraphSpacing which was already available in the native layer but not wired up
  • Android: Extends EnrichedCheckboxListSpan.chooseHeight() to increase fm.descent/fm.bottom after the last line of each paragraph
  • Defaults to 0 so existing behavior is unchanged

Usage

<EnrichedTextInput
  htmlStyle={{
    ulCheckbox: {
      paragraphSpacing: 6,
    },
  }}
/>

Changes

JS Layer (3 files):

  • src/types.ts — Added paragraphSpacing?: number to ulCheckbox
  • src/spec/EnrichedTextInputNativeComponent.ts — Added paragraphSpacing?: Float to native ulCheckbox
  • src/utils/normalizeHtmlStyle.ts — Added paragraphSpacing: 0 default

iOS Native (4 files):

  • ios/config/InputConfig.h — Declared checkboxListParagraphSpacing getter/setter
  • ios/config/InputConfig.mm — Added ivar, copy, getter/setter
  • ios/styles/CheckboxListStyle.mm — Set pStyle.paragraphSpacing when adding/removing checkbox attributes
  • ios/EnrichedTextInputView.mm — Read new prop and apply to config

Android (3 files):

  • android/.../EnrichedStyle.kt — Added ulCheckboxParagraphSpacing to interface
  • android/.../EnrichedCheckboxListSpan.kt — Extended chooseHeight() to add spacing after last line of paragraph
  • android/.../HtmlStyle.kt — Added property, parsing, equals(), hashCode()

Notes

  • No breaking changes — defaults to 0
  • Tested on iOS with Expo SDK 55

🤖 Generated with Claude Code

Add a `paragraphSpacing` property to `ulCheckbox` in `HtmlStyle` to control
vertical spacing between checkbox list items.

iOS: Uses `NSMutableParagraphStyle.paragraphSpacing` which was already
available but not wired up.

Android: Extends `EnrichedCheckboxListSpan.chooseHeight()` to increase
`fm.descent`/`fm.bottom` after the last line of each paragraph.

Defaults to 0 (no change in existing behavior).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ErionTp ErionTp force-pushed the feat/checkbox-paragraph-spacing branch from afca9cd to fe0a7d8 Compare March 8, 2026 19:16
@ErionTp ErionTp changed the title feat(ios): add paragraphSpacing to checkbox list feat: add paragraphSpacing to checkbox list (iOS + Android) Mar 8, 2026
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.

1 participant