Skip to content

Commit 0c6b9ea

Browse files
committed
feat: enhance NitroTextView layout handling and action mode configuration
- Implemented a layout change listener in NitroTextView to ensure proper height adjustment for content expansion. - Renamed createCustomActionModeCallback to configureActionModeCallback for clarity in action mode handling. - Updated NitroText interface to use consistent object notation for platform specifications.
1 parent b574401 commit 0c6b9ea

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

android/src/main/java/com/nitrotext/NitroTextView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class NitroTextView(ctx: Context) : ReactViewGroup(ctx) {
5454

5555
private fun updateActionModeCallback() {
5656
textView.customSelectionActionModeCallback = customMenus?.takeIf { it.isNotEmpty() }
57-
?.let { createCustomActionModeCallback(it) }
57+
?.let { configureActionModeCallback(it) }
5858
}
5959

60-
private fun createCustomActionModeCallback(menus: Array<MenuItem>): ActionMode.Callback {
60+
private fun configureActionModeCallback(menus: Array<MenuItem>): ActionMode.Callback {
6161
val menuItemMap = menus.mapIndexedNotNull { index, item ->
6262
if (item.title.isNotEmpty()) { Menu.FIRST + index to item } else null
6363
}.toMap()

src/specs/nitro-text.nitro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ export interface NitroTextMethods extends HybridViewMethods {}
148148
export type NitroText = HybridView<
149149
NitroTextProps,
150150
NitroTextMethods,
151-
{ ios: 'swift'; android: 'kotlin' }
151+
{ ios: 'swift', android: 'kotlin' }
152152
>

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,4 @@ export function getStyleProps(styles: Partial<Fragment>) {
260260
}
261261

262262
return props
263-
}
263+
}

0 commit comments

Comments
 (0)