editor context menu, focus fix

This commit is contained in:
Jan Prochazka
2021-03-11 07:53:37 +01:00
parent 5f97f7d922
commit c193955fbe
6 changed files with 91 additions and 12 deletions

View File

@@ -31,7 +31,13 @@
$: selectedIndex = true ? 0 : filter;
onMount(() => domInput.focus());
onMount(() => {
const oldFocus = document.activeElement;
domInput.focus();
return () => {
if (oldFocus) oldFocus.focus();
};
});
$: sortedComands = _.sortBy(
Object.values($commands).filter(x => x.enabled),