react-native-highlight-text-view 0.1.12 → 0.1.14

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.
@@ -88,10 +88,12 @@ class HighlightTextViewManager : SimpleViewManager<HighlightTextView>(),
88
88
  horizontalAlign = null
89
89
  }
90
90
 
91
- // Determine vertical gravity
91
+ // Determine vertical gravity - preserve existing if not specified
92
92
  val vGravity = when (verticalAlign) {
93
93
  "top" -> Gravity.TOP
94
94
  "bottom" -> Gravity.BOTTOM
95
+ "center" -> Gravity.CENTER_VERTICAL
96
+ null -> view?.gravity?.and(Gravity.VERTICAL_GRAVITY_MASK) ?: Gravity.CENTER_VERTICAL
95
97
  else -> Gravity.CENTER_VERTICAL
96
98
  }
97
99
 
@@ -220,10 +222,15 @@ class HighlightTextViewManager : SimpleViewManager<HighlightTextView>(),
220
222
  isFocusable = value
221
223
  isFocusableInTouchMode = value
222
224
  isEnabled = value
225
+ // Always keep multiline flag to preserve newlines, even when not editable
223
226
  inputType = if (value) {
224
227
  InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
225
228
  } else {
226
- InputType.TYPE_NULL
229
+ InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE or InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
230
+ }
231
+ // Prevent keyboard from showing when not editable
232
+ if (!value) {
233
+ setShowSoftInputOnFocus(false)
227
234
  }
228
235
  }
229
236
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-highlight-text-view",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
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",