#3684 closed Bug (fixed)
Edit area adding <p> when clicking in the edit area
Reported by: | Damian | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | |
Keywords: | IBM Confirmed Review+ | Cc: |
Description
To reproduce:
- Open nightly sample
- Add a table with default settings
- Click in the editing area, next to the table (to the right of the table in LTR mode)
Results in a new <p> being added to the document. The document grows with every subsequent click.
<p> </p>
Reproduced on IE 6 and 7.
Attachments (4)
Change History (15)
comment:1 Changed 16 years ago by
Keywords: | Confirmed added |
---|---|
Owner: | set to Garry Yao |
Status: | new → assigned |
comment:2 Changed 16 years ago by
This has been proven to be out the range of #3657.
After some investigation, this's been caused by a feature from IE and Webkit:
- If 'mousedown' event is beside the table, move the selection right following the table;
- If 'Arrow Key' keypress event is happened at the last table cell editing position, move the selection out same as 1.
Which will result in a rare selection as:
<table>...</table>^
Now that our 'auto fixing block-less logic' commit a crime by "fixing" this into:
<table>...</table><p>^</p> // A new paragraph is established.
comment:3 Changed 16 years ago by
After talking with Fred, we found that not only happen for <table> and even happen for FF, reproduce with:
- Load the editor with:
<hr />
- Click on the spaces around top margin of this hr;
- Result: New line appended.
comment:4 Changed 16 years ago by
Keywords: | Review? added |
---|
We already know that the fixBody functionality is for good of guarantee user could always type inside a enter block(p,div) , so if we found such a selection, it indicate that user is trying to exit from some block( maybe table, pre, hr ), so now we should not fix immediately, instead, we're checking whether there's already a 'enter block' around, if found, we'll simply moving into that paragraph, so user could continue to type inside it OR user could press enter now for new paragraph if he want.
comment:5 Changed 16 years ago by
Summary: | [IE] Edit area adding <p> when clicking in the edit area → Edit area adding <p> when clicking in the edit area |
---|
Changed 16 years ago by
Attachment: | 3684.patch added |
---|
comment:6 follow-up: 7 Changed 16 years ago by
Keywords: | Review- added; Review? removed |
---|
The proposed patch is not handling collapsed selections inside text nodes properly.
I would propose coming with a solution that makes all necessary checks "after" fixing the block to see if it works well. We can then compare both solutions and decide which one to (fix) and take.
Changed 16 years ago by
Attachment: | 3684_2.patch added |
---|
Changed 16 years ago by
Attachment: | 3684_3.patch added |
---|
comment:7 Changed 16 years ago by
Keywords: | Review? added; Review- removed |
---|
Replying to fredck:
The proposed patch is not handling collapsed selections inside text nodes properly.
I would propose coming with a solution that makes all necessary checks "after" fixing the block to see if it works well. We can then compare both solutions and decide which one to (fix) and take.
- 3684_2.patch is an enhancement of original approach;
- 3684_3.patch is following your proposal;
Please compare these two while reviewing.
comment:8 Changed 16 years ago by
Keywords: | Review- added; Review? removed |
---|
3684_3.patch is causing some strange selection shifts when the editor document has more than 1 non-enter mode blocks at the end. e.g.
- Open replacebyclass.html in IE.
- Press Enter at the end of the first paragraph to create a new paragraph.
- Inside the new paragraph, change the paragraph format to "Normal (DIV)".
- Press Enter again to create another DIV. Now you should have to DIV paragraphs at the end of the document.
- Click on the first DIV paragraph - no problem.
- Click on the second DIV paragraph - a P paragraph is created (which is ok), and the caret shifts into the newly created P (this is wrong).
Changed 16 years ago by
Attachment: | 3684_4.patch added |
---|
comment:9 Changed 16 years ago by
Keywords: | Review? added; Review- removed |
---|
It seems that in IE it's possible to leak selection into body even for block element like 'div' and 'blockquote', so we should disable the possibility of exiting from them with a new paragrah.
After the patch, it's still possible for user to exit from no matter what block. E.g, if you want to exit from, let's say a 'div' into a 'p', you can press enter at the end it, and change newly created 'div' into 'p'.
comment:10 Changed 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:11 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This's supposed to be fixed with #3657.