Opened 8 years ago

Closed 8 years ago

#4269 closed Bug (fixed)

"Esc" and "Enter" keystrokes are not handled when a dialogue box is opened which causes the form post automatically

Reported by: Pranav Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.1
Component: General Version:
Keywords: Oracle Review+ Cc: Pranav, Senthil

Description

Open a dialogue box using Image or Link controls and press "Enter" or "Esc". You will observe that the form post is happening automatically. This is affecting our application functionality. Please give high priority to get it fixed.

Attachments (6)

replacebycode.html (2.5 KB) - added by Pranav 8 years ago.
Sample HTML File
4269.patch (3.1 KB) - added by Tobiasz Cudnik 8 years ago.
4269_2.patch (2.1 KB) - added by Tobiasz Cudnik 8 years ago.
replacebycode_enter.html (2.9 KB) - added by Senthil 8 years ago.
4269_3.patch (1.6 KB) - added by Garry Yao 8 years ago.
4269_4.patch (2.2 KB) - added by Garry Yao 8 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 Changed 8 years ago by Frederico Caldeira Knabben

Cc: Pranav Senthil added; Pranav Senthil removed
Milestone: CKEditor 3.0CKEditor 3.1

comment:2 Changed 8 years ago by Tobiasz Cudnik

Keywords: Pending added
Owner: set to Tobiasz Cudnik
Status: newassigned

What browser is affected by this issue ? Checked FF 3.5 and couldn't reproduce it. Also it's strange that form post could be triggered by ESC key...

To be clear, we're talking about form in which CKEditor is nested (or at least textarea which it replaces). Not form inside dialog box.

comment:3 in reply to:  2 Changed 8 years ago by Pranav

Replying to tobiasz.cudnik:

What browser is affected by this issue ? Checked FF 3.5 and couldn't reproduce it. Also it's strange that form post could be triggered by ESC key...

To be clear, we're talking about form in which CKEditor is nested (or at least textarea which it replaces). Not form inside dialog box.

Both IE and Firefox are afected by this issue. "Enter" keystroke causes form post in IE as well as Firefox. "Esc" keystroke causes form post in Firefox only. IE is working fine for "Esc" keystroke. I am attaching a sample html file to reproduce the issue.

Changed 8 years ago by Pranav

Attachment: replacebycode.html added

Sample HTML File

comment:4 Changed 8 years ago by Tobiasz Cudnik

Keywords: Confirmed added; Pending removed

comment:5 Changed 8 years ago by Tobiasz Cudnik

Keywords: Review? added

Provided example made things clear, thank you.

Attahced patch prevents ESC and ENTER keys from bubbling up (outside the dialog) in all 3 type of key events, which works with attached sample.

Changed 8 years ago by Tobiasz Cudnik

Attachment: 4269.patch added

comment:6 Changed 8 years ago by Garry Yao

Keywords: Pending added; Review? removed

Ticket Test added at : http://ckeditor.t/tt/4269/4269.html.

comment:7 Changed 8 years ago by Garry Yao

I don't see this as an bug from the editor, instead I see a problem of the events handling at the provided sample page:

<body onkeypress="return submitenter(event)">

The editor dialog key events is naturally part of the host page and should be bubbled up, it's not a good option for us to prevent this default behavior only because of the your above way ( others may argue that they need this event ).

comment:8 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review? added; Pending removed

I'm ok to stop these two specific keys. It's not a big issue, after all ours is an indepent application. The only important thing here is being sure that elements inside the dialog are receiving the event, as we may have fields that need these keys to perform some action. We don't need to care about things outside the dialog instead.

Changed 8 years ago by Tobiasz Cudnik

Attachment: 4269_2.patch added

comment:9 Changed 8 years ago by Tobiasz Cudnik

There was a little issue with Enter key in first patch, which was able to bubble up if focus was outside text fields.

Key events are canceled after dialog's key system, so it's no change for it (dialog key system). All key handlers are attached to element above dialog holder div, which is body.

comment:10 Changed 8 years ago by Garry Yao

Keywords: Review+ added; Review? removed

comment:11 Changed 8 years ago by Tobiasz Cudnik

Resolution: fixed
Status: assignedclosed

Fixed with [4165].

comment:12 Changed 8 years ago by Senthil

Keywords: Confirmed Review+ removed
Resolution: fixed
Status: closedreopened

We have verified this issue in the patch "4269_2.patch" and nightly build as well but we still see the form post issue after pressing the enter or escape keys on top of any ckeditor dialogs(Ex: Table control). I have attached the sample html file(replacebycode_enter.html) here, please copy the file into the ckeditor\_sample folder and try again. This is really a critical issue, Please provide the appropriate priority.

Changed 8 years ago by Senthil

Attachment: replacebycode_enter.html added

comment:13 Changed 8 years ago by Senthil

Issue can be reproduced on IE7,8 & FF3.5

Changed 8 years ago by Garry Yao

Attachment: 4269_3.patch added

comment:14 Changed 8 years ago by Garry Yao

Keywords: Review? added

Senthil's TC has failed because it contains such kind of "dead angle" event handler which turn out to be always triggered before ours.

document.addEventListener( 'keydown', function(){...}, false );

It's a fault for our dialog key handling system to consume events on the host document, we could safely have them on the dialog element instead.
Ticket Test updated.

comment:15 Changed 8 years ago by Garry Yao

Priority: HighNormal

The priority field is an internal flag used by developers, please avoid using it.

comment:16 Changed 8 years ago by Garry Yao

Owner: changed from Tobiasz Cudnik to Garry Yao
Status: reopenednew

comment:17 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

It doesn't fix the issue. I've just opened the table dialog and hit ENTER... the form gets posted.

Changed 8 years ago by Garry Yao

Attachment: 4269_4.patch added

comment:18 Changed 8 years ago by Garry Yao

Keywords: Review? added; Review- removed
Status: newassigned

Precisely, previous patch only doesn't work for 'keyup' event of 'enter' key in Firefox: Enter key hiding the dialog ( make the element invisible ) which will potentially drop any other event listeners ( the bubbling locker )in the queue.

comment:19 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:20 Changed 8 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

Fixed with [4584].

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy