react-crud-mobile 1.0.643 → 1.0.644
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/dist/react-crud-mobile.cjs.development.js +17 -17
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +17 -17
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIListRow.tsx +14 -13
package/package.json
CHANGED
|
@@ -38,6 +38,20 @@ export default function UIListRow(props: UIListRowType) {
|
|
|
38
38
|
})
|
|
39
39
|
);
|
|
40
40
|
|
|
41
|
+
const viewRef = useRef(null);
|
|
42
|
+
const [visible, setVisible] = useState(false);
|
|
43
|
+
const windowHeight = Dimensions.get('window').height;
|
|
44
|
+
const checkIfVisible = () => {
|
|
45
|
+
const nodeHandle = findNodeHandle(viewRef.current);
|
|
46
|
+
|
|
47
|
+
if (nodeHandle && !visible) {
|
|
48
|
+
UIManager.measure(nodeHandle, (x, y, width, height, pageX, pageY) => {
|
|
49
|
+
const isVisible = pageY >= 0 && pageY + height <= windowHeight;
|
|
50
|
+
setVisible(isVisible);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
41
55
|
const onClick = (item: any) => {
|
|
42
56
|
row.call('click', { value: item, item, edit: true, index });
|
|
43
57
|
};
|
|
@@ -45,19 +59,6 @@ export default function UIListRow(props: UIListRowType) {
|
|
|
45
59
|
const ListItem = () => {
|
|
46
60
|
let [updateIndex, setUpdateIndex] = useState(0);
|
|
47
61
|
let key = scope.key('item');
|
|
48
|
-
const viewRef = useRef(null);
|
|
49
|
-
const [visible, setVisible] = useState(false);
|
|
50
|
-
const windowHeight = Dimensions.get('window').height;
|
|
51
|
-
const checkIfVisible = () => {
|
|
52
|
-
const nodeHandle = findNodeHandle(viewRef.current);
|
|
53
|
-
|
|
54
|
-
if (nodeHandle && !visible) {
|
|
55
|
-
UIManager.measure(nodeHandle, (x, y, width, height, pageX, pageY) => {
|
|
56
|
-
const isVisible = pageY >= 0 && pageY + height <= windowHeight;
|
|
57
|
-
setVisible(isVisible);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
62
|
|
|
62
63
|
const getRowStyle = () => {
|
|
63
64
|
let css = row.getStyle('row', { ...styles.row });
|