Fix image selection for context menu on Shift+F10 - #3418
Merged
Conversation
|
juliaroldi
marked this pull request as ready for review
July 28, 2026 18:49
juliaroldi
requested review from
BryanValverdeU,
JiuqingSong,
flyingbee2012,
ianeli1 and
vinguyen12
July 28, 2026 18:49
JiuqingSong
reviewed
Jul 28, 2026
|
|
||
| render() { | ||
| const theme = getTheme(this.state.isDarkMode); | ||
| this.imageEditPlugin = this.state.initState.pluginList.imageEditPlugin |
Collaborator
There was a problem hiding this comment.
You can recreate plugin in getToggleablePlugins
Contributor
Author
There was a problem hiding this comment.
Recreate the plugin in getToggleablePlugins will make the ribbons buttons lose the plugin reference. I added a change to reset the plugin when we reset the editor, so the plugin will be reset in the editor and for ribbon buttons.
JiuqingSong
approved these changes
Jul 29, 2026
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.
Summary
When a range selection contains a single image, pressing Shift+F10 (the keyboard shortcut that opens the context menu) now promotes the selection to an image selection before the menu opens. This ensures the context menu operates on the image rather than the surrounding text range. Implemented in
SelectionPlugin.tsby detectingShift+F10on a range selection and, whenisSingleImageInSelectionreturns an image, callingsetDOMSelectionwith animageselection.The demo
MainPane.tsxchange movesimageEditPlugininitialization intorender()so it reflects current init state.How to test