friendofsvelte / tipex

An goto sytled text editor for SvelteKit; based on TipTap; tipex
https://tipex.pages.dev/
43 stars 0 forks source link

Weird issue on focus change #11

Closed Bishwas-py closed 6 months ago

Bishwas-py commented 6 months ago

Here's the issue:

Uncaught TypeError: Cannot read properties of null (reading 'contains')
    at HTMLDocument.onFocusChange (@friendofsvelte_tipex.js?v=84a7d262:1874:55)

onMount(async () => {
    const onFocusChange = function() {
      $$invalidate(1, isEditorFocused = editorsParent.contains(document.activeElement));
    };
    onFocusChange();
    document.addEventListener("focusin", onFocusChange);
    document.addEventListener("focusout", onFocusChange);
  });
Bishwas-py commented 6 months ago

Fixed on 0.0.1-act.11