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

  1. 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)
  2. Use the UI to add a table
  3. 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)

table-insertion-bug.js (411 bytes) - added by Dylan Fitzgerald 8 years ago.
JS to reproduce
Fullscreen_4_13_16__2_15_PM.png (513.3 KB) - added by Dylan Fitzgerald 8 years ago.
Screenshot of detecting cursor position incorrectly

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Dylan Fitzgerald

Attachment: table-insertion-bug.js added

JS to reproduce

Changed 8 years ago by Dylan Fitzgerald

Screenshot of detecting cursor position incorrectly

comment:1 Changed 8 years ago by Dylan Fitzgerald

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().

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy