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

range._getTableElement sometimes returns invalid result #3101

Closed
jacekbogdanski opened this issue May 13, 2019 · 0 comments · Fixed by #3365
Closed

range._getTableElement sometimes returns invalid result #3101

jacekbogdanski opened this issue May 13, 2019 · 0 comments · Fixed by #3365
Assignees
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@jacekbogdanski
Copy link
Member

jacekbogdanski commented May 13, 2019

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open https://codepen.io/jacekbogdanski/pen/BeVmxX
  2. Open console.

Expected

Table element for both console logs.

Actual

Null for both console logs.


The issue has been already covered for Safari, although it also occurs on Chrome. It probably makes sense to remove browser sniffing or at least enable the fix for Chrome. The issue is still reproducible on Safari when start container points outside the table.

https://github.com/ckeditor/ckeditor-dev/blob/36ad5d9fddff8173290854e36f25cfcea2b83cfb/core/dom/range.js#L2760-L2762

Also, the condition should be probably reversed for the endContainer i.e.

if ( endTable && start.equals( this.root ) ) {
	return end.getAscendant( tableElements, true );
}

The issue can be reproduced by making partial table selection without tableselection plugin. Mostly, you want to create selection where start or end container points into element outside the table - so selection should be placed on the edge of the table.

Other details

  • Browser: Chrome, Safari
  • CKEditor version: 4.7.0
  • Installed CKEditor plugins: table
@jacekbogdanski jacekbogdanski added type:bug A bug. core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. labels May 13, 2019
@f1ames f1ames added this to the 4.12.1 milestone May 27, 2019
@f1ames f1ames modified the milestones: 4.12.1, 4.13.0 Jun 26, 2019
@msamsel msamsel self-assigned this Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants