-
Notifications
You must be signed in to change notification settings - Fork 19
Conversation
…verted child elements.
…k content is selected inside table cell.
…esent in the table.
# Conflicts: # tests/converters/downcast.js
# Conflicts: # src/tableediting.js
src/converters/table-post-fixer.js
Outdated
writer.insertElement( 'tableCell', Position.createAt( table.getChild( rowIndex ), 'end' ) ); | ||
const tableCell = writer.createElement( 'tableCell' ); | ||
writer.insert( tableCell, Position.createAt( table.getChild( rowIndex ), 'end' ) ); | ||
writer.insertElement( 'paragraph', tableCell ); |
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.
// Check all nodes inside table cell on insert/remove operations (also other blocks). | ||
const tableCell = entry.position && entry.position.parent; | ||
|
||
if ( tableCell && tableCell.is( 'tableCell' ) ) { |
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.
tableCell.is( 'tableCell' )
😉
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 could name it possibleTableCell
;P
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.
Or parent
. But tableCell
is fine too.
src/converters/upcasttable.js
Outdated
|
||
const tableCell = conversionApi.writer.createElement( 'tableCell' ); | ||
conversionApi.writer.insert( tableCell, ModelPosition.createAt( row, 'end' ) ); | ||
conversionApi.writer.insertElement( 'paragraph', ModelPosition.createAt( tableCell, 'end' ) ); |
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.
src/converters/upcasttable.js
Outdated
|
||
// Continue after inserted element. | ||
data.modelCursor = data.modelRange.end; | ||
}, { priority: 'normal' } ); |
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.
Normal is a default value, so I would not define it. It's a detail but it's a few bytes of code more.
The code looks good to me. I found a few places where you can reduce the number of created operations (it should matter for insertRow and insertColumn commands where many operations are created at once). |
Yeah - I've already pinged oleq about this. |
…ommands/utils~getParentElement() to findAncestor().
Steps to reproduce
Current resultThe editor crashes. NotesThe editor crashes after deleting every type of a block element. It won't crash if you'll use cut instead of delete. Error
Browser: All browsers |
Steps to reproduce
Current resultThe table toolbar has disappeared. Browser: Edge, Chrome, Safari In Firefox, the toolbar disappears for a second and shows up again. |
Steps to reproduce
Current resultWhole table's content is selected. Browser: All browsers |
Steps to reproduce
Current resultThe selection moves to the beginning of the editor. (edit) Reported here: https://github.com/ckeditor/ckeditor5-widget/issues/50) |
After some testing and talks - I'd remove Image support in tables for this MVP as widget-ception causes some problems. Added a follow-up: #99. |
Fixed:
|
@oskarwrobel & @Mgsy I've updated the PR with your comments i mind :) |
Suggested merge commit message (convention)
Feature: Support block content inside table. Closes ckeditor/ckeditor5#3199.
BREAKING CHANGE: Removed
table/commands/utils~getParentTable()
method. Usetable/commands/utils~findAncestor()
instead.Additional information
isLimit
elements should be selectable.