mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(app): refocus the editor before text context menu actions (#3292)
This commit is contained in:
1 parent
0906a85d6f
commit
c3d790f664
2 files changed
+13
-7
No files matched your search
@@ -140,12 +140,6 @@ export const TextareaContextMenu = observer(
|
||||
}
|
||||
targetElement.focus({preventScroll: true});
|
||||
};
|
||||
const handleReplaceMisspelling = async (suggestion: string) => {
|
||||
if (electronAPI?.spellcheckReplaceMisspelling) {
|
||||
await electronAPI.spellcheckReplaceMisspelling(suggestion);
|
||||
}
|
||||
onClose();
|
||||
};
|
||||
const handleAddToDictionary = async () => {
|
||||
if (!misspelledWord) return;
|
||||
Spellcheck.addPersonalWord(misspelledWord);
|
||||
@@ -167,6 +161,11 @@ export const TextareaContextMenu = observer(
|
||||
requestAnimationFrame(action);
|
||||
});
|
||||
};
|
||||
const handleReplaceMisspelling = (suggestion: string) => {
|
||||
runAfterClose(() => {
|
||||
void electronAPI?.spellcheckReplaceMisspelling?.(suggestion);
|
||||
});
|
||||
};
|
||||
const execCommand = (command: string) => {
|
||||
runAfterClose(() => {
|
||||
document.execCommand(command);
|
||||
|
||||
Reference in new issue
Block a user