Skip to content

Commit 660f89c

Browse files
authored
feat: big query results freeze interface (#1354)
1 parent 22d151b commit 660f89c

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/components/QueryResultTable/Cell/Cell.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import {hideTooltip, showTooltip} from '../../../store/reducers/tooltip';
3+
import {showTooltip} from '../../../store/reducers/tooltip';
44
import {useTypedDispatch} from '../../../utils/hooks';
55
import {b} from '../QueryResultTable';
66

@@ -14,13 +14,6 @@ export const Cell = React.memo(function Cell(props: CellProps) {
1414

1515
const dispatch = useTypedDispatch();
1616

17-
React.useEffect(
18-
() => () => {
19-
dispatch(hideTooltip());
20-
},
21-
[dispatch],
22-
);
23-
2417
return (
2518
<span
2619
className={b('cell', className)}

src/containers/ReduxTooltip/ReduxTooltip.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ function ReduxTooltip(props) {
2323
rect: {top: props.positions?.top, left: props.positions?.left},
2424
});
2525

26+
const handleScroll = React.useCallback(() => {
27+
const {hideTooltip, toolTipVisible} = props;
28+
if (toolTipVisible) {
29+
setTimeout(() => hideTooltip(), 500);
30+
}
31+
}, [props]);
32+
2633
React.useEffect(() => {
2734
window.addEventListener('scroll', handleScroll, true);
2835
return () => {
2936
window.removeEventListener('scroll', handleScroll);
3037
};
31-
}, []);
32-
33-
const handleScroll = () => {
34-
const {hideTooltip, toolTipVisible} = props;
35-
if (toolTipVisible) {
36-
setTimeout(() => hideTooltip(), 500);
37-
}
38-
};
38+
}, [handleScroll]);
3939

4040
const renderPositionPopup = (visible, positions, data, additionalData) => {
4141
const {template, popupClassName, hideTooltip} = props;

0 commit comments

Comments
 (0)