mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 03:18:12 +08:00
Fix Eyedropper tool and make Svelte's bind:this more robust
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
const dialog = getContext<DialogState>("dialog");
|
||||
|
||||
let self: FloatingMenu;
|
||||
let self: FloatingMenu | undefined;
|
||||
|
||||
export function dismiss() {
|
||||
dialog.dismissDialog();
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
onMount(() => {
|
||||
// Focus the first button in the popup
|
||||
const emphasizedOrFirstButton = (self.div().querySelector("[data-emphasized]") || self.div().querySelector("[data-text-button]") || undefined) as HTMLButtonElement | undefined;
|
||||
const emphasizedOrFirstButton = (self?.div()?.querySelector("[data-emphasized]") || self?.div()?.querySelector("[data-text-button]") || undefined) as HTMLButtonElement | undefined;
|
||||
emphasizedOrFirstButton?.focus();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user