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

Table selection does not cooporate with typing #6284

Closed
jodator opened this issue Feb 18, 2020 · 2 comments Β· Fixed by ckeditor/ckeditor5-table#254
Closed

Table selection does not cooporate with typing #6284

jodator opened this issue Feb 18, 2020 · 2 comments Β· Fixed by ckeditor/ckeditor5-table#254
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jodator
Copy link
Contributor

jodator commented Feb 18, 2020

πŸ“ Provide detailed reproduction steps (if any)

  1. Make mouse selection in table for 2+ table cells
  2. Type something

βœ”οΈ Expected result

You should be able to type in last table cell.

❌ Actual result

Something breaks

πŸ“ƒ Other details

I've tried to fix this issue with

this.listenTo( viewDocument, 'keydown', () => {
	if ( !this.hasMultiCellSelection ) {
		return;
	}

	editor.model.change( writer => {
		const end = this._endElement;
		this.clearSelection();
		writer.setSelection( end.getChild( 0 ), 0 );
	} );
}, { priority: 'highest' } );

In the TableSelection class and it works well but it needs some behavior polishing. For isntance arrows do not work as expected (you end up in different cell then end one.


If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

@jodator jodator added type:bug This issue reports a buggy (incorrect) behavior. package:table labels Feb 18, 2020
@jodator jodator added this to the iteration 30 milestone Feb 18, 2020
@jodator jodator changed the title Table selection does cooporate with typing Table selection does not cooporate with typing Feb 18, 2020
@Reinmar
Copy link
Member

Reinmar commented Feb 21, 2020

This should be handled in the ckeditor5-typing package. There's a listener for keydown which should make sure that the selection is collapsed. Let's move the selection to the first cell. We don't even need to select its content.

@Reinmar
Copy link
Member

Reinmar commented Feb 26, 2020

May be blocked by #6328.

Reinmar added a commit to ckeditor/ckeditor5-table that referenced this issue Feb 28, 2020
Feature: Clear selected table contents (in case of multi-cell selection) on various occasions: when cutting the content, starting typing, when pressing <kbd>Enter</kbd>, etc. Closes ckeditor/ckeditor5#6119. Closes ckeditor/ckeditor5#6284. Closes ckeditor/ckeditor5#6301.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants