Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: errors caused by events fired while editor is not initialized yet #2532

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

neSpecc
Copy link
Member

@neSpecc neSpecc commented Nov 8, 2023

Problem

Users reported problems with errors that happen by document click at the moment when Editor is not fully initialised:

image

Cause

Our current TS setup is not strict. So we missed some cases, when module nodes field can contain undefined values (when UI is not fully constructed)

Se we don't have check for undefined in many places, including documentClicked or document.onMouseOver event handlers.

Solution

  • Add undefined type to some module nodes
  • Handle undefined case in event handlers
  • Wrap document event binding with reequestIdleCallback to bind them only when UI is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants