Opened 8 years ago
Last modified 8 years ago
#14585 new Bug
Table insertion fires insertElement before moving cursor inside itself
Reported by: | Dylan Fitzgerald | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Tables | Version: | 4.5.9 |
Keywords: | Cc: |
Description
Steps to reproduce
- Add an insertElement listener to the editor that performs actions at the current cursor position (example code attached; you can just dump it into your browser JS console)
- Use the UI to add a table
- Observe cursor position in table cell A1
Expected result
The listener's action should be performed with the cursor inside the table, where it's presented to the user.
Actual result
The listener's action is performed at the location where the cursor was prior to table insertion.
Other details (browser, OS, CKEditor version, installed plugins)
I've verified this in the CKE nightly at http://nightly.ckeditor.com/16-04-13-06-07/standard/samples/ using FF 45.0.2 and Chrome 49.0.2623.112 (64-bit), both on MacOS X 10.11.4.
Attachments (2)
Change History (3)
Changed 8 years ago by
Attachment: | table-insertion-bug.js added |
---|
Changed 8 years ago by
Attachment: | Fullscreen_4_13_16__2_15_PM.png added |
---|
Screenshot of detecting cursor position incorrectly
comment:1 Changed 8 years ago by
This results from the workaround to fix #7959.
Cf. https://github.com/ckeditor/ckeditor-dev/blob/c1fc9a9a2c1ee7cfebab01948cd1ed77ffdef5b3/plugins/table/dialogs/table.js#L235 in which the cursor is moved using a callback via setTimeout()
.
JS to reproduce