Skip to content

fix: add null check for webviewRef in focus/blur event listeners#340

Open
sonubintw wants to merge 1 commit into
10play:mainfrom
sonubintw:fix/addEventListener-undefined-error
Open

fix: add null check for webviewRef in focus/blur event listeners#340
sonubintw wants to merge 1 commit into
10play:mainfrom
sonubintw:fix/addEventListener-undefined-error

Conversation

@sonubintw

Copy link
Copy Markdown

Fixes issue where addEventListener was called on undefined webviewRef, causing isFocused state to not sync properly when editor gains/loses focus.

Fixes issue where addEventListener was called on undefined webviewRef,
causing isFocused state to not sync properly when editor gains/loses focus.
Copilot AI review requested due to automatic review settings January 28, 2026 18:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the native-side editor bridge to keep the isFocused state in sync when blur() is invoked.

Changes:

  • Update BridgeState.isFocused to false in blur() via _updateEditorState when editorStateRef.current is available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/bridges/core.ts
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.

2 participants