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

Not possible to delete two lists selected by text #4875

Closed
jswiderski opened this issue Sep 8, 2021 · 2 comments · Fixed by #4943
Closed

Not possible to delete two lists selected by text #4875

jswiderski opened this issue Sep 8, 2021 · 2 comments · Fixed by #4943
Assignees
Labels
plugin:list The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. type:bug A bug.
Milestone

Comments

@jswiderski
Copy link
Contributor

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open e.g. https://nightly.ckeditor.com/21-09-08-06-03/full/samples/
  2. Switch to source mode and paste the following HTML
<p>begin</p>

<ul>
	<li>t1</li>
	<li>t2</li>
	<li>t3</li>
</ul>

<p>middle</p>

<ul>
	<li>t21</li>
	<li>t22</li>
</ul>

  1. Select everything from first list item (t1) to last list item in the second list (t22)
    obraz
  2. Press delete or backspace

Expected result

Whole text gets deleted.

Actual result

Only second list gets deleted.
obraz

Other details

  • Browser: Any
  • OS: Any
  • CKEditor version: 4.0 (I could reproduce it in 4.0)
  • Installed CKEditor plugins: list
@jswiderski jswiderski added type:bug A bug. plugin:list The plugin which probably causes the issue. labels Sep 8, 2021
@lslowikowska lslowikowska added the support:2 An issue reported by a commercially licensed client. label Sep 8, 2021
@Comandeer Comandeer added status:confirmed An issue confirmed by the development team. size:? labels Sep 13, 2021
@KarolDawidziuk KarolDawidziuk self-assigned this Oct 26, 2021
@KarolDawidziuk
Copy link
Contributor

First thoughts.

When we add another list and select three as in the example above, only the last list will be removed. When we add an empty paragraph before the first list it's been working.
In this place we're checking whether the entire list has been selected, but for some reason it seems that only the first list has been selected as a whole, returning range from the last and removing it.

If we don't select the entire list the content will be removed from a selected range, not from the range returned by the above-mentioned function.
At this moment we can try to update getSelectedTableList() function to check if we have selected more than one whole list and return the range with startContainer pointing to the beginning of the first selected list.

@CKEditorBot
Copy link
Collaborator

Closed in #4943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:list The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants