Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Dec 16, 2022

closes #150.

There are basically three ways that the editor could lose focus:

  1. the user clicked on the page outside the editor
  2. the user tabbed after hitting the Ctrl-M or Ctrl-Shift-M (on Mac) combo (which temporarily disables focus trapping, I learned today)
  3. the iframe captures it

All we need to do, therefore, is determine whether a focusout event was caused by 1 or 2, and if not, recapture the focus. It seems to work reliably for me

@vercel
Copy link

vercel bot commented Dec 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
learn-svelte-dev ✅ Ready (Inspect) Visit Preview Dec 16, 2022 at 5:00PM (UTC)

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(leaving a comment above the boolean so future selves know what the fuck is going on)

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

Successfully merging this pull request may close these issues.

Text input focus sometimes lost on rerender/error
2 participants