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

Firefox: Right-clicking on multiple selected cells containing empty paragraphs removes the selection #2003

Closed
jswiderski opened this issue May 22, 2018 · 1 comment
Labels
browser:firefox The issue can only be reproduced in the Firefox browser. plugin:tableselection The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support 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. Paste below table with paragraphs in Firefox into https://sdk.ckeditor.com/samples/table.html
    <table style="width:500px"><tbody><tr><td><p>&nbsp;</p></td><td><p>&nbsp;</p></td></tr><tr><td><p>&nbsp;</p></td><td><p>&nbsp;</p></td></tr></tbody></table>
  2. Select all cells
  3. Right-click on one of cells, select Cell Properties and apply Blue background.

Expected result

Selection stays and background gets applied to all cells.

Actual result

Selection disappears and background gets applied only to right-clicked cell.

Other details

Problem can only be reproduced in Firefox (both standard and ESR) but only when table contains empty paragraphs and right-click is performed on a cell with the empty paragraph.

If table doesn't contain empty paragraphs or right-click is performed on a cell with non-empty paragraph everything works as expected. Also by default the table inserted through toolbar button has no paragraphs so the problem doesn't occur there as well.

  • Browser: Firefox
  • OS: Windows
  • CKEditor version: 4.9.2
  • Installed CKEditor plugins: table, tableselection
@jswiderski jswiderski added type:bug A bug. support An issue reported by a commercially licensed client. browser:firefox The issue can only be reproduced in the Firefox browser. status:confirmed An issue confirmed by the development team. labels May 22, 2018
@mlewand mlewand added the plugin:tableselection The plugin which probably causes the issue. label May 28, 2018
@engineering-this
Copy link
Contributor

engineering-this commented Jun 7, 2018

After digging around:

Browsers I tested (including Firefox on MacOS) fire event contextmenu right after mousedown. However on Windows Firefox fires contextmenu after mouseup, and it changes selection between mousedown and mouseup. I'd propose to store selection when evt.data.$.button == 2 (which should refer to right click). And at this point add listener once( 'mouseup'... and restore selection.

Edit: I found piece of code from 2010 which produces this bug. PR is incoming.

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

No branches or pull requests

3 participants