Opened 16 years ago
Closed 15 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)
Change History (26)
comment:1 Changed 16 years ago by
Cc: | Pranav Senthil added; Pranav Senthil removed |
---|---|
Milestone: | CKEditor 3.0 → CKEditor 3.1 |
comment:2 follow-up: 3 Changed 16 years ago by
Keywords: | Pending added |
---|---|
Owner: | set to Tobiasz Cudnik |
Status: | new → assigned |
comment:3 Changed 16 years ago by
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.
comment:4 Changed 16 years ago by
Keywords: | Confirmed added; Pending removed |
---|
comment:5 Changed 16 years ago by
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 16 years ago by
Attachment: | 4269.patch added |
---|
comment:6 Changed 16 years ago by
Keywords: | Pending added; Review? removed |
---|
Ticket Test added at : http://ckeditor.t/tt/4269/4269.html.
comment:7 Changed 16 years ago by
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 16 years ago by
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 16 years ago by
Attachment: | 4269_2.patch added |
---|
comment:9 Changed 16 years ago by
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 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:12 Changed 15 years ago by
Keywords: | Confirmed Review+ removed |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
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 15 years ago by
Attachment: | replacebycode_enter.html added |
---|
Changed 15 years ago by
Attachment: | 4269_3.patch added |
---|
comment:14 Changed 15 years ago by
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 15 years ago by
Priority: | High → Normal |
---|
The priority field is an internal flag used by developers, please avoid using it.
comment:16 Changed 15 years ago by
Owner: | changed from Tobiasz Cudnik to Garry Yao |
---|---|
Status: | reopened → new |
comment:17 Changed 15 years ago by
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 15 years ago by
Attachment: | 4269_4.patch added |
---|
comment:18 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|---|
Status: | new → assigned |
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 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
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.