question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Excalidraw component steals focus

See original GitHub issue

Standalone Excalidraw component tries to focus itself on page load. This leads to jumps on long pages. This seems like it should be configurable or off for the standalone version.

https://github.com/excalidraw/excalidraw/blob/abfc58eb24ee37af9f8a0922f7bf61f83d625aca/src/components/App.tsx#L836

My temporary workaround:

if (typeof HTMLDivElement !== 'undefined') {
  const realFocus = HTMLDivElement.prototype.focus;
  HTMLDivElement.prototype.focus = function() {
    if (this.className.indexOf('excalidraw-container') === -1) {
      realFocus.apply(this, arguments);
    }
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ad1992commented, Jun 2, 2021

closed via #3691

1reaction
ad1992commented, May 31, 2021

Sure go for it @h7y 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't delete a shape when iframe loses focus #3151 - GitHub
From what I can see: clicking outside the iframe steals focus from it, and clicking back inside on the ... excalidraw/src/components/App.tsx.
Read more >
One Year of Excalidraw - Hacker News
Because it kinda looks like a child's work it takes off the edge of noticing useless details and carries the intent better. The...
Read more >
Building a React Application: Part I | by Eric Gibby - Medium
React is a powerful JavaScript library whose primary focus is on rendering fast, performant UIs, using one-way data-binding to populate the ...
Read more >
Bountysource
Excalidraw component steals focus.
Read more >
Next.js Conf 2022: React Roundup - Bitovi
Next.js's focus this year on innovating "routing, rendering, ... Excalidraw also included RNG to determine which user takes precedence, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found