Opened 12 years ago
Last modified 9 years ago
#10169 confirmed Bug
Editor context menu unavailable when opened outside the body element of the content area
Reported by: | SteveB | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | 4.0 Beta |
Keywords: | IBM | Cc: | angel.koilov@…, Damian, Teresa Monahan, satya_minnekanti@… |
Description
I added an Screen shot to make it more simple to understand the ticket.
There is an section where you can enter text at the CKEditor, in the following called content section. If you enter a small text at the content section and leave out enough unfilled place in the content section you can't paste text inside the editor. If you right click in the free place of the content section the browsers default context-menu will be opened but not the context menu of the CKEditor. While the text selection cursor will be changed, the context menu keeps missing.
Attachments (1)
Change History (15)
Changed 12 years ago by
Attachment: | ckEditorBug.jpg added |
---|
comment:1 Changed 12 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.0 → 4.0 Beta |
Problem can be reproduced from CKEditor 4.0 beta.
This issue has to do with body tag boundaries. When user clicks outside of body, listener responsible isn't fired and browser context menu shows up.
Please note that it isn't hard to click outside of body boundaries - body has margins so if you click in that margin (near scrollbar) you get the same result. The same thing is happening when there is little text in editor - body is smaller than content area.
comment:2 Changed 12 years ago by
Cc: | angel.koilov@… added |
---|---|
Version: | 4.0 Beta → 4.1.1 |
comment:3 Changed 12 years ago by
Version: | 4.1.1 → 4.0 Beta |
---|
@po_taka please don't change version number - it is used to indicate when problem started occurring.
comment:4 Changed 11 years ago by
Cc: | Damian Teresa Monahan added |
---|---|
Keywords: | IBM added |
#9493 was marked as duplicate.
Problem can be reproduced in every browser from CKEditor 4.0 beta.
comment:5 Changed 11 years ago by
Workaround is modifying contents.css file.
- Minimum height min-height:200px can be added to .body rule.
- Margins and paddings can be removed for body rule.
comment:6 Changed 11 years ago by
comment:7 Changed 10 years ago by
Drag and Drop gets also affeced by small contentarea.
#12222 was marked as duplicate.
comment:8 Changed 10 years ago by
I tried to debug this and found that in v3 we listened on the document when on v4 we listen on the editable.
In branch:t/10169 I proposed switching back to the document, but unfortunately IE11 turned out to be a problem. When the menu is being opened the selection is empty and that causes numerous plugins to fail (workarounded in the second commit).
While the patch seems to be ok, I can see two problems:
- It will break many 3rd party plugins.
- It would be much better if there always existed some selection when opening the context menu. So instead of changing other plugins we should try to workaround the empty selection problem in the context menu plugin. But from what I see this may be much harder, because forcing focus didn't help.
comment:9 Changed 10 years ago by
#7979 was marked as duplicate.
Please see 7979#comment:8 for a proof of concept for fixing this problem. IMHO changing CSS seems to be the best and only way to fix this ticket.
comment:11 Changed 10 years ago by
Cc: | satya_minnekanti@… added |
---|
comment:12 Changed 9 years ago by
Summary: | ContextMenu not at whole ContentSection available → Editor context menu unavailable when opened outside the body element of the content area |
---|
comment:13 Changed 9 years ago by
Minimum height min-height:200px can be added to .body rule.
While this may be appealing because it seems to be very simple, unfortunately it's not. The body element can be styled in many ways (it can have margins, borders, etc.) what makes it pretty tricky to calculate what should be the min-height
. If we'll set it to a too low value it will not cover the entire viewport. If to too high value then scrollbars will appear too often.
A more stable solution could be what I proposed in comment:8, but it requires some tinkering to correctly preset the selection.
comment:14 Changed 9 years ago by
What makes it pretty tricky to calculate what should be the min-height.
That is correct; you will never get it right. The idea was to make the body higher to cover e.g. 80-90% of initial viewport (people don't resize editor that often). That way you will limit ne number of times when you will not see editor context menu.
I was for min-height or this CSS workaround because they are light-weight comparing to JS solution.
Missing paste menu at content section of CKEditor