Feat/open input not focus (#811)

* Fixed click outside

* Finished

* Fixed tests
This commit is contained in:
Lucas Bordeau
2023-07-22 07:09:02 +02:00
committed by GitHub
parent 0f3f6fa948
commit 62720944fa
15 changed files with 192 additions and 88 deletions

View File

@ -5,6 +5,7 @@ import { HotkeyScope } from '@/ui/hotkey/types/HotkeyScope';
import { useCurrentCellEditMode } from '../hooks/useCurrentCellEditMode';
import { useIsSoftFocusOnCurrentCell } from '../hooks/useIsSoftFocusOnCurrentCell';
import { useRegisterEditableCell } from '../hooks/useRegisterEditableCell';
import { EditableCellDisplayMode } from './EditableCellDisplayMode';
import { EditableCellEditMode } from './EditableCellEditMode';
@ -48,6 +49,8 @@ export function EditableCell({
const hasSoftFocus = useIsSoftFocusOnCurrentCell();
useRegisterEditableCell(editHotkeyScope);
return (
<CellBaseContainer>
{isCurrentCellInEditMode ? (
@ -62,7 +65,7 @@ export function EditableCell({
{editModeContent}
</EditableCellEditMode>
) : hasSoftFocus ? (
<EditableCellSoftFocusMode editHotkeyScope={editHotkeyScope}>
<EditableCellSoftFocusMode>
{nonEditModeContent}
</EditableCellSoftFocusMode>
) : (