Fix major rework on view (#2262)
This commit is contained in:
@ -1,8 +1,11 @@
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
|
||||
import { currentHotkeyScopeState } from '@/ui/utilities/hotkey/states/internal/currentHotkeyScopeState';
|
||||
|
||||
import { currentTableCellInEditModePositionState } from '../states/currentTableCellInEditModePositionState';
|
||||
import { isTableCellInEditModeFamilyState } from '../states/isTableCellInEditModeFamilyState';
|
||||
import { useSetSoftFocusOnCurrentTableCell } from '../table-cell/hooks/useSetSoftFocusOnCurrentTableCell';
|
||||
import { TableHotkeyScope } from '../types/TableHotkeyScope';
|
||||
|
||||
export const useMoveSoftFocusToCurrentCellOnHover = () => {
|
||||
const setSoftFocusOnCurrentTableCell = useSetSoftFocusOnCurrentTableCell();
|
||||
@ -18,6 +21,17 @@ export const useMoveSoftFocusToCurrentCellOnHover = () => {
|
||||
isTableCellInEditModeFamilyState(currentTableCellInEditModePosition),
|
||||
);
|
||||
|
||||
const currentHotkeyScope = snapshot
|
||||
.getLoadable(currentHotkeyScopeState)
|
||||
.valueOrThrow();
|
||||
|
||||
if (
|
||||
currentHotkeyScope.scope !== TableHotkeyScope.TableSoftFocus &&
|
||||
currentHotkeyScope.scope !== TableHotkeyScope.CellEditMode
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isSomeCellInEditMode.contents) {
|
||||
setSoftFocusOnCurrentTableCell();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user