-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable the logic in ImageEdit plugin to set image editing when users click images #1405
Disable the logic in ImageEdit plugin to set image editing when users click images #1405
Conversation
If you extended this class, I think you don't need to add such parameter. Instead, you just need to override onPluginEvent, and don't call super.onPluginEvent() if the event is SelectionChanged event. |
class MyImageEdit extends ImageEdit {
onPluginEvent(e) {
if (e.type != PluginEventType.SelectionChanged) {
super.onPluginEvent(e);
}
}
} |
That's our current temporary workaround actually. But the point is, on the one hand, we want to leverage the implementation of ImageEdit as more as possible, we just want to avoid this plugin handling users' click to activate the editing, but we still want to keep other events handling logic implemented in this plugin. On the other hand, before the recent change, we had some workaround, but it was broken due to the latest upgrade. So we'd like to add this parameter to let the people working on this plugin know that they should make sure this option always works. Or we have to patch our workaround again and again. |
Ok in that case, we need a better way. You may noticed there are two states of image editing:
interface ImageEditOptions {
...
onSelectState: ImageEditOperation; /* default: ImageEditOperation.Resize */
} |
966b2e9
to
aff7d0b
Compare
Updated |
packages/roosterjs-editor-types/lib/interface/ImageEditOptions.ts
Outdated
Show resolved
Hide resolved
packages/roosterjs-editor-types/lib/interface/ImageEditOptions.ts
Outdated
Show resolved
Hide resolved
Hey @JiuqingSong , could you help merge this PR? I don't have the permission |
We extended this plugin for mobile user and used a custom way to activate image editing. So we need an option to disable the default one.