Skip to content

[iOS] TextInput with Hiragino Sans: extra space on text selection and text clipping at the bottom #56123

@ryota0222

Description

@ryota0222

Description

When using fontFamily: 'Hiragino Sans' on a on iOS, two rendering issues occur:

  1. Text selection shows extra space below the text — When selecting text in a multiline TextInput, the selection highlight area extends significantly below the actual text glyphs, creating a large visible gap.
  2. Text is clipped at the bottom in single-line TextInput — Characters with descenders (e.g., p, y, j) are cut off at the bottom. This occurs with both placeholder and actual input text.

Both issues do not occur when using the default system font (San Francisco). This appears to be caused by the font metrics (ascender/descender ratio) of Hiragino Sans not being properly accounted for in TextInput's rendering.

Note: Hiragino Sans is a system-bundled font on iOS, widely used for Japanese typography.

Steps to reproduce

  1. Create a with style={{ fontFamily: 'Hiragino Sans', fontSize: 16 }}
  2. Issue 1: In a multiline TextInput, type text (e.g., "Hello World") and select it — observe extra space below the selection highlight
  3. Issue 2: Observe the single-line TextInput with text "https://example.com/yyy.jp" — the bottom of characters like p, y, j is clipped. This happens for both defaultValue and placeholder.
  4. Compare with the system font TextInput — neither issue occurs

React Native Version

0.83

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.1
  CPU: (8) arm64 Apple M2
Binaries:
  Node: 20.19.0
SDKs:
  iOS SDK: 18.1
IDEs:
  Xcode: 16.1/16B40

Stacktrace or Logs

N/A (visual rendering issue, no errors)

MANDATORY Reproducer

https://snack.expo.dev/@ryotanny/hiragino-sans-textinput-bug

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions