react-native-highlight-text-view 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,9 +102,9 @@ class RoundedBackgroundSpan(
102
102
  0f
103
103
  }
104
104
 
105
- // Vertical overlap to eliminate gaps
106
- val topExtend = 4f
107
- val bottomExtend = 4f
105
+ // Vertical overlap to eliminate gaps (reduced to prevent descender clipping)
106
+ val topExtend = 0f
107
+ val bottomExtend = 0f
108
108
 
109
109
  // Calculate background rect
110
110
  // NOTE: Since this is a ReplacementSpan, 'x' is the start of the span (including padding).
@@ -547,10 +547,14 @@ class HighlightTextView : AppCompatEditText {
547
547
  val textStr = editable.toString()
548
548
  if (textStr.isEmpty()) return
549
549
 
550
- // Apply line height if specified
550
+ // Apply line height if specified, or add spacing for padding
551
551
  if (customLineHeight > 0) {
552
552
  val lineSpacingMultiplier = customLineHeight / textSize
553
553
  setLineSpacing(0f, lineSpacingMultiplier)
554
+ } else {
555
+ // Add line spacing to accommodate vertical padding and prevent overlap
556
+ val extraSpacing = charPaddingTop + charPaddingBottom
557
+ setLineSpacing(extraSpacing, 1.0f)
554
558
  }
555
559
 
556
560
  isUpdatingText = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-highlight-text-view",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "A native text input for React Native that supports inline text highlighting",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",