-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Auto embed] Wrong insertion position when using the context menu #2757
Comments
My guess:
|
If this is seriously impairing embedding via paste via ctx menu, then you can raise this ticket to one of the current iterations. |
My guess is that right-click/contex menu changes selection... also I wonder how this will work with #1243. |
Then, the paste occurs in the block and we do not break the block in such case but insert block after (or before). I think that insert content needs to be smarter than just: delete content + insert in the new position, to handle cases like this. This is a different case than inserting content with the collapsed position inside a block. |
But autoembedding (IMO) should happen directly where you paste a link. It should not use that smart insertion mechanism, IMO. How does it work now? |
But then the block is inserted and it uses this smart insertion mechanism. I think it should be applied for dropping. We tested it for images and it is hard to set selection precisely. It would be very easy to break a paragraph even if you do not want to if we would allow paragraph breaking on paste. This is why I think that the mechanism should be applied and do not break the paragraph. However, it should work only for collapsed selection, and if it is true what you said that in this case the selection is not collapsed, we need to fix such selection too and put the collapsed selection between blocks. |
But this ticket is about autoembed. When you paste a link in, usually, a very precisely chosen location. It'd be weird that you have such a content: <p>Foo. []Bar</p>
<p>Bom</p> You paste a link so you see this for a second: <p>Foo. https://youtube.com/whataver[]Bar</p>
<p>Bom</p> And suddenly you get this: <p>Foo. []Bar</p>
<media></media>
<p>Bom</p> |
I +1 the suggestion that auto-embed should be done in-place. This seems like a natural and logical solution. |
Fix: The `AutoMediaEmbed` feature should insert media in place of a pasted link. Closes #36. Closes #49.
<h1>Foo</h1>[]<h1>Bar</h1>...
Expected
<h1>Foo</h1><media><h1>Bar</h1>...
Actual
<h1>Foo</h1><h1>Bar</h1><media>...
It could be related to https://github.com/ckeditor/ckeditor5-media-embed/issues/12 and #1243. But the strange thing is it works fine when Cmd+V is used instead.
cc @pjasiun @jodator @pomek
The text was updated successfully, but these errors were encountered: