@react-native-hero/picker 0.1.3 → 0.1.5
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.
|
@@ -25,7 +25,7 @@ class PickerView(private val reactContext: ThemedReactContext) : WheelView(react
|
|
|
25
25
|
val stringList = arrayListOf<String>()
|
|
26
26
|
|
|
27
27
|
for (i in 0 until value.size()) {
|
|
28
|
-
val map = value.getMap(i)
|
|
28
|
+
val map = value.getMap(i)!!
|
|
29
29
|
var text = "undefined"
|
|
30
30
|
if (map.hasKey("text")) {
|
|
31
31
|
text = map.getString("text") as String
|
|
@@ -86,7 +86,7 @@ class PickerView(private val reactContext: ThemedReactContext) : WheelView(react
|
|
|
86
86
|
// putMap 必须传入 WritableMap
|
|
87
87
|
// 如果直接传 ReadableMap 会报错
|
|
88
88
|
val option = Arguments.createMap()
|
|
89
|
-
option.merge(options.getMap(value))
|
|
89
|
+
option.merge(options.getMap(value)!!)
|
|
90
90
|
|
|
91
91
|
map.putMap("option", option)
|
|
92
92
|
sendEvent("onChange", map)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.github.reactnativehero.picker
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.*
|
|
4
|
-
import com.facebook.react.common.MapBuilder
|
|
5
4
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
5
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
6
|
import com.facebook.react.uimanager.ViewProps
|
|
@@ -48,9 +47,14 @@ class RNTPickerManager(private val reactAppContext: ReactApplicationContext) : S
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
override fun getExportedCustomBubblingEventTypeConstants(): MutableMap<String, Any> {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
val baseEventTypeConstants = super.getExportedCustomBubblingEventTypeConstants()
|
|
51
|
+
val eventTypeConstants = baseEventTypeConstants ?: mutableMapOf()
|
|
52
|
+
eventTypeConstants.putAll(
|
|
53
|
+
mapOf(
|
|
54
|
+
"onChange" to mapOf("phasedRegistrationNames" to mapOf("bubbled" to "onChange")),
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
return eventTypeConstants
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
}
|