Skip to content

[Bug]: Editor loses focus a few seconds after stopping typing (Auto-save collision) #942

Description

@meusistemabr

Describe the bug

While typing a note in MassCode, if I stop typing for a few seconds, the text area completely loses focus, forcing me to click inside the editor again to continue typing.

To reproduce

  1. Open any note.
  2. Type some text.
  3. Stop typing and wait 2-3 seconds (triggering the auto-save debounce).
  4. The cursor disappears and focus is lost from the text area.

Technical Context: This seems to be caused by the bt.updateListener.of listener inside the CodeMirror initialization. When the debounced save function triggers (P(!1) inside the un() scheduler), it causes a reactive state mutation that forces Vue to re-render or re-instantiate the CodeMirror state, causing document.activeElement to lose focus.

App Version and Architecture

5.12.0 Mac OS X Tahoe 26.6.2 arm64

System info

System:
  OS: macOS 26.6.2
  CPU: Apple M2
  Memory: 8 GB
  Shell: 5.9 - /bin/zsh

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions