react-native-platform-components 0.5.2 → 0.5.3

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.
@@ -417,6 +417,9 @@ class PCSelectionMenuView(context: Context) : FrameLayout(context) {
417
417
  suppressInlineSpinnerCallbacks(sp)
418
418
  sp.setSelection(target, false)
419
419
  }
420
+
421
+ // Update headless menu checked state
422
+ refreshHeadlessMenu()
420
423
  }
421
424
 
422
425
  // ---- Inline dropdown overlay ----
@@ -528,10 +531,13 @@ class PCSelectionMenuView(context: Context) : FrameLayout(context) {
528
531
  }
529
532
 
530
533
  private fun refreshHeadlessMenu() {
531
- val menu = headlessMenu?.menu ?: return
534
+ val popup = headlessMenu ?: return
535
+ val menu = popup.menu
532
536
  menu.clear()
537
+ val selectedIdx = options.indexOfFirst { it.data == selectedData }
533
538
  options.forEachIndexed { index, opt ->
534
- menu.add(0, index, index, opt.label)
539
+ val label = if (index == selectedIdx) "✓ ${opt.label}" else " ${opt.label}"
540
+ menu.add(0, index, index, label)
535
541
  }
536
542
  }
537
543
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-platform-components",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "A cross-platform toolkit of native UI components for React Native.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",