-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
@Reinmar Finally done - all issues should be resolved. The go-to is a manual test with placeholder inline widget POC. Works:
The build is green on CI. |
Changed inline-widget manual sample to use it. Removed CSS-created '{}' from manual sample.
I've added mapper callback for non-empty view element -> empty model element mapping. I've modified the manual sample to use it. Also, |
|
||
model.insertContent( placeholder ); | ||
|
||
writer.setSelection( placeholder, 'on' ); |
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'm wondering – shouldn't that placeholder be selected by insertContent()
? If it was a block, it would be. However, if it was a block, the case is slightly different because the selection should not be set after it. So selecting it is the most reasonable solution. In case of inline objects, we can set the selection after this element (and we do that now). WDYT?
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.
From UX perspective, I think that setting the selection after the inline-widget is defensible. You insert the widget and maybe want to go on with writing.
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.
Actually, I can asnwer this myself – pasting should not select the placeholder, so should not insertContent()
.
BTW. I am missing one here thing, which I forgot to add. The widget has no label, resulting in no description for fake selection. I think we should encourage people to add these so it should be in a guide and I guess in the manual sample too. |
Suggested merge commit message (convention)
Other: Introduce inline widget sample. Closes ckeditor/ckeditor5#1096.
Additional information
ps.: WIP as other PRs requires tests