@momo-kits/auto-complete 0.0.59-rc.1 → 0.0.60-beta.10
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.
- package/AutoComplete.js +14 -16
- package/package.json +1 -1
package/AutoComplete.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
View,
|
|
9
9
|
Platform,
|
|
10
10
|
} from 'react-native';
|
|
11
|
-
import { get } from 'lodash';
|
|
11
|
+
import { debounce, get } from 'lodash';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
13
|
import {
|
|
14
14
|
ValueUtil,
|
|
@@ -34,11 +34,12 @@ export default class AutoComplete extends Component {
|
|
|
34
34
|
*/
|
|
35
35
|
measure() {
|
|
36
36
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
Object.keys(this.hashmapRefs)?.forEach((key) => {
|
|
38
|
+
const node = findNodeHandle(this.hashmapRefs[key]);
|
|
39
|
+
if (node) {
|
|
39
40
|
if (Platform.OS === 'android') {
|
|
40
41
|
UIManager.measureLayoutRelativeToParent(
|
|
41
|
-
|
|
42
|
+
node,
|
|
42
43
|
(e) => {
|
|
43
44
|
console.error(e);
|
|
44
45
|
},
|
|
@@ -51,19 +52,16 @@ export default class AutoComplete extends Component {
|
|
|
51
52
|
},
|
|
52
53
|
);
|
|
53
54
|
} else {
|
|
54
|
-
UIManager.measure(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
);
|
|
55
|
+
UIManager.measure(node, (x, y, width, height) => {
|
|
56
|
+
this.hashmapPosition[key] = {
|
|
57
|
+
x,
|
|
58
|
+
y: y + height,
|
|
59
|
+
width,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
64
62
|
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
67
65
|
} catch (e) {
|
|
68
66
|
console.log(`try catch :: ${e}`);
|
|
69
67
|
}
|