Skip to content
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

Drop inline object in text #16101

Closed
jirivinduska opened this issue Mar 26, 2024 · 7 comments · Fixed by #17433
Closed

Drop inline object in text #16101

jirivinduska opened this issue Mar 26, 2024 · 7 comments · Fixed by #17433
Labels
support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jirivinduska
Copy link

📝 Ask a question

I created a custom inline object that inherits all from inlineObject that contain one other element.

<inline><foo></foo></inline>

This custom can not be dropped into text. The drop target position never lands to #text. The only way to insert it inside the text is to place it next to another inline object - this way, the drop target caret shows. Is there some configuration or method to force showing drop target inside text?

I was curious, and if inlineObject does not contain anything, then the drop target position works as expected.

@jirivinduska jirivinduska added the type:question This issue asks a question (how to...). label Mar 26, 2024
@jirivinduska
Copy link
Author

Anything?

@Witoso
Copy link
Member

Witoso commented Apr 4, 2024

Hi! Could you provide some recording? I'm not sure if I understand.

@Witoso Witoso added the pending:feedback This issue is blocked by necessary feedback. label Apr 4, 2024
@jirivinduska
Copy link
Author

Screen.Recording.2024-04-04.at.13.54.21.mov

Basicaly in the recording I have three widgets two of them are inline the footnote and the Equation (Inline) and one of them is normal block widget Equation (block).

When I try to drag and drop footnote which is empty inline widget it is working as expected. Drop zone is correctly triggered in text. When I try to drag and drop Inline Equation it does not work properly it does not let me drop in text, only next to other inline widgets. Inline Equation is widget which is not empty and looks like this in model

<inline><math></math></inline> possibly this is the reason why it does not work, but can I somehow oelvercome this by forcing drop zone in text for this inline widget?

@CKEditorBot CKEditorBot removed the pending:feedback This issue is blocked by necessary feedback. label Apr 5, 2024
@jirivinduska
Copy link
Author

jirivinduska commented Apr 9, 2024

any news?

@jirivinduska
Copy link
Author

Do you know how to resolve this?

@jirivinduska
Copy link
Author

Bump

@lslowikowska lslowikowska added the support:2 An issue reported by a commercially licensed client. label Oct 24, 2024
@niegowski
Copy link
Contributor

The problem here is in this check:

const canDropOnPosition = !draggedRange || Array
.from( draggedRange.getItems() )
.every( item => model.schema.checkChild( targetModelPosition, item as Node ) );

It should check only top-level items and ignore all nested ones.

@niegowski niegowski added type:bug This issue reports a buggy (incorrect) behavior. and removed type:question This issue asks a question (how to...). labels Nov 8, 2024
arkflpc added a commit that referenced this issue Nov 8, 2024
Fix (clipboard): An in-text drop of an inline object with elements inside should be possible. Closes #16101.
@CKEditorBot CKEditorBot added this to the iteration 80 milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants