Skip to content

Commit

Permalink
fix(range-selector): focus after confirm (#4029)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gggpound authored Nov 12, 2024
1 parent 1762023 commit 0e5bd85
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,19 @@ export function RangeSelector(props: IRangeSelectorProps) {
rangeDialogVisibleSet(false);
onRangeSelectorDialogVisibleChange(false);
setTimeout(() => {
isFocusSet(true);
editor?.setSelectionRanges([{ startOffset: text.length, endOffset: text.length }]);
focus();
}, 30);
};

const handleClose = () => {
rangeDialogVisibleSet(false);
onRangeSelectorDialogVisibleChange(false);
setTimeout(focus, 30);
setTimeout(() => {
isFocusSet(true);
focus();
}, 30);
};

const handleOpenModal = () => {
Expand All @@ -335,6 +340,7 @@ export function RangeSelector(props: IRangeSelectorProps) {
setTimeout(() => {
rangeDialogVisibleSet(true);
onRangeSelectorDialogVisibleChange(true);
isFocusSet(false);
}, 30);
}
};
Expand Down

0 comments on commit 0e5bd85

Please sign in to comment.