[Super Editor][IME][Bug]: Fix zombie IME client when switching from one SuperEditor instance to a replacement SuperEditor instance (Resolve #2965)#2967
Merged
matthew-carroll merged 4 commits intoMar 8, 2026
Conversation
… one SuperEditor instance to a replacement SuperEditor instance (Resolve #2965)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Super Editor][IME][Bug]: Fixed zombie IME client when switching from one SuperEditor instance to a replacement SuperEditor instance (Resolve #2965)
From the issue ticket:
Problem: The existing IME connection, which survives across the widget instance change, it bound to the IME client for SuperEditor 1, which is different from the IME client for SuperEditor 2. As a result, IME input keeps flowing to the defunct IME client, which belongs to the now disposed SuperEditor 1. This means the keyboard stays up, the user is typing, suggested input continues to display at the top of the keyboard, and yet nothing changes in the editor.
This problem is the result of me originally thinking that we could re-use the connection. I missed the fact that when claiming the SharedIme, and passing the client, we need to create an entirely new connection for the client, even if a connection is already open. There is no option in Flutter's API to replace one client with another, within the same connection.
One wrinkle to also remember here is that, I believe, when we open a new connection, we must tell the keyboard to show() if we want it to stay up. By default, if we don't do that, creating a new connection causes the keyboard to close.