react-crud-mobile 1.0.653 → 1.0.655
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 +3 -3
- 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 +3 -3
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIListRow.tsx +1 -1
- package/src/hooks/useIsVisible.ts +3 -2
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ export default function UIListRow(props: UIListRowType) {
|
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
const targetRef = useRef(null);
|
|
34
|
-
const isVisible = useIsVisible(targetRef,
|
|
34
|
+
const isVisible = useIsVisible(targetRef, row);
|
|
35
35
|
|
|
36
36
|
const onClick = (item: any) => {
|
|
37
37
|
row.call('click', { value: item, item, edit: true, index });
|
|
@@ -16,7 +16,8 @@ export function useIsVisible(ref: any, scope: Scope) {
|
|
|
16
16
|
const windowHeight = window.innerHeight;
|
|
17
17
|
const visible = rect.top < windowHeight && rect.bottom > 0;
|
|
18
18
|
|
|
19
|
-
scope.visible = visible;
|
|
19
|
+
if (visible) scope.visible = visible;
|
|
20
|
+
|
|
20
21
|
setIsVisible(visible);
|
|
21
22
|
}
|
|
22
23
|
} else {
|
|
@@ -24,7 +25,7 @@ export function useIsVisible(ref: any, scope: Scope) {
|
|
|
24
25
|
const windowHeight = Dimensions.get('window').height;
|
|
25
26
|
const visible = y < windowHeight && y + height > 0;
|
|
26
27
|
|
|
27
|
-
scope.visible = visible;
|
|
28
|
+
if (visible) scope.visible = visible;
|
|
28
29
|
setIsVisible(visible);
|
|
29
30
|
});
|
|
30
31
|
}
|