react-native-ui-lib 7.41.1-snapshot.6935 → 7.41.1-snapshot.6946

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.
@@ -45,7 +45,7 @@ export default class TextInputKeyboardManager {
45
45
  };
46
46
  }
47
47
  function findNodeHandle(ref) {
48
- return ReactNative.findNodeHandle(ref.current || ref);
48
+ return ref.current?.getNodeHandle?.() || ref?.getNodeHandle?.() || ReactNative.findNodeHandle(ref.current || ref);
49
49
  }
50
50
  const springAnimation = {
51
51
  duration: 400,
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilib-native",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "homepage": "https://github.com/wix/react-native-ui-lib",
5
5
  "description": "uilib native components (separated from js components)",
6
6
  "main": "components/index",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.41.1-snapshot.6935",
3
+ "version": "7.41.1-snapshot.6946",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -13,23 +13,27 @@ const useNewPickerProps = props => {
13
13
  renderHeader,
14
14
  renderOverlay
15
15
  } = props;
16
- const modalProps = {
16
+ const defaultModalProps = {
17
17
  animationType: 'slide',
18
18
  transparent: Constants.isIOS && enableModalBlur,
19
19
  enableModalBlur: Constants.isIOS && enableModalBlur,
20
20
  onRequestClose: topBarProps?.onCancel
21
21
  };
22
+ const mergedModalProps = {
23
+ ...defaultModalProps,
24
+ ...(onShow && {
25
+ onShow
26
+ }),
27
+ ...pickerModalProps,
28
+ ...customPickerProps?.modalProps
29
+ };
22
30
  const newProps = {
23
31
  renderHeader: renderCustomDialogHeader || renderHeader,
24
32
  renderInput: renderPicker || renderInput,
25
33
  renderOverlay: renderCustomModal || renderOverlay,
26
34
  customPickerProps: {
27
- modalProps: {
28
- onShow,
29
- ...modalProps,
30
- ...pickerModalProps
31
- },
32
- ...customPickerProps
35
+ ...customPickerProps,
36
+ modalProps: mergedModalProps
33
37
  }
34
38
  };
35
39
  return newProps;
@@ -1,10 +1,12 @@
1
1
  import { useContext, useImperativeHandle, useRef } from 'react';
2
+ import { findNodeHandle } from 'react-native';
2
3
  import FieldContext from "./FieldContext";
3
4
  const useImperativeInputHandle = (ref, props) => {
4
5
  const inputRef = useRef();
5
6
  const context = useContext(FieldContext);
6
7
  useImperativeHandle(ref, () => {
7
8
  return {
9
+ getNodeHandle: () => inputRef.current ? findNodeHandle(inputRef.current) : null,
8
10
  isFocused: () => inputRef.current?.isFocused(),
9
11
  focus: () => inputRef.current?.focus(),
10
12
  blur: () => inputRef.current?.blur(),