Skip to content

fix: guard focus/keyboard callbacks with mounted checks in QuillRawEditorState#2738

Open
hardiklakhalani wants to merge 1 commit into
singerdmx:masterfrom
hardiklakhalani:fix/mounted-guard-focus-keyboard-callback
Open

fix: guard focus/keyboard callbacks with mounted checks in QuillRawEditorState#2738
hardiklakhalani wants to merge 1 commit into
singerdmx:masterfrom
hardiklakhalani:fix/mounted-guard-focus-keyboard-callback

Conversation

@hardiklakhalani

Copy link
Copy Markdown

Description

Fixes a lifecycle race where _handleFocusChanged schedules post-frame work that can run after QuillRawEditorState is disposed, causing a crash when createKeyboardAppearance() accesses context.

Problem

When the render object is dirty, _handleFocusChanged:

  1. Calls requestKeyboard() immediately
  2. Schedules another _handleFocusChanged() via addPostFrameCallback
    If the editor is unmounted between scheduling and execution (e.g. parent widget structure changes during async UI updates), the callback throws:

Related Issues

Related #2737

Type of Change

  • Feature: New functionality without breaking existing features.
  • 🛠️ Bug fix: Resolves an issue without altering current behavior.
  • 🧹 Refactor: Code reorganization, no behavior change.
  • Breaking: Alters existing functionality and requires updates.
  • 🧪 Tests: New or modified tests
  • 📝 Documentation: Updates or additions to documentation.
  • 🗑️ Chore: Routine tasks, or maintenance.
  • Build configuration change: Build/configuration changes.

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.

1 participant