-
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
Shadow dom image wrapper #1520
Shadow dom image wrapper #1520
Conversation
Create a long rectangle image, insert it. Then rotate, I think the size of wrapper SPAN is wrong (or incorrectly rotated?) That causes the image float higher than other text. Maybe not a new issue, but better also fix it. |
this.disposer = editor.addDomEventHandler('blur', this.onBlur); | ||
this.disposer = editor.addDomEventHandler({ | ||
blur: () => this.onBlur, | ||
drop: e => e.preventDefault(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should disable onDrag instead, and only disable when image is in editing.
// When left click in a image that already in editing mode, do not quit edit mode | ||
// This will avoid another image into the editor after drag | ||
const mouseTarget = e.rawEvent.target; | ||
const button = e.rawEvent.button; | ||
if ( | ||
this.shadowSpan !== mouseTarget || | ||
(this.shadowSpan === mouseTarget && button !== 0) || | ||
this.isCropping | ||
) { | ||
this.setEditingImage(null); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…u/juliaroldi/shadow-dom-image-wrapper
6795fc4
to
4aca7d0
Compare
Instead of insert the image wrapper with a cloned image outside the editor and overlay the image wrapper, add the image wrapper with a cloned image into shadow dom and let it handle hiding the original image. After this change, the code to handle zoom issues and image overlaying the toolbar above the editor will be not needed. Also, code to add auto low to the rotator handle, remove the wrapper before dispose the editor and avoid drop image while in editing mode was added.