Opened 12 years ago

Last modified 8 years ago

#9361 review_failed Bug

Context menu not displayed in correct position when invoked using keyboard shortcut (Shift + F10 or application key)

Reported by: Satya Minnekanti Owned by: Olek Nowodziński
Priority: Normal Milestone:
Component: UI : Context Menu Version: 4.0
Keywords: IBM Cc: Damian, Teresa Monahan, irinauru@…

Description (last modified by Jakub Ś)

To reproduce the defect:

  1. Open Massive inline editing sample
  1. Click inside any div & press Shift + Control + F10 to open Context menu.

Expected Result: Context menu opens & displayed next to current cursor position

Actual Result: Context menu opens but displayed at top left hand corner of browser. but if we use Application key Context menu displays next to current cursor position.


  1. Open iframe based sample (replacebycode)
  1. Click inside text somewhere in the middle & press Shift + Control + F10 to open Context menu.

Context menu opens in upper left corner of editor (iframed page)

Change History (22)

comment:1 Changed 11 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.0.1
Status: newconfirmed

comment:3 in reply to:  2 Changed 11 years ago by Satya Minnekanti

Replying to j.swiderski:

@satya, based on your #9366 I have reported I have created 3 separate issues with menu not showing as expected - #9574, #9575, #9576.

I think that your ticket another example of breaking the menu and displaying native on in upper left corner. But I think the TC is a little bit incorrect. Here the correct IMHO TC:

To reproduce the defect:

  1. Open Massive inline editing sample
  2. Click inside div with image (click on text)
  3. Press Shift + Control + F10 - nothing will happen (as this key combination is not opening context menu)
  4. Click on image and press SHIFT + F10

Browser native context menu will be shown in upper left corner.

@satya – can you confirm/deny this?

@j.swiderski I would deny them bcoz..In all the defects #9574 #9575 #9576 you mentioned to use Shift+F10 to open Editor Context menu, but we have to use Shift + Control + F10 in 4.0.. So then i would say all your defects are invalid.

comment:4 Changed 11 years ago by Jakub Ś

Description: modified (diff)
Summary: Inline editing: Context menu not displayed in correct position when invoked using keyboard shortcut (Shift + Control + F10)Context menu not displayed in correct position when invoked using keyboard shortcut (Shift + Control + F10)

comment:5 Changed 11 years ago by Jakub Ś

@satya both SHIFT+F10 and SHIFT+CRTL+F10 work in editor - my bad.

The problem is that menu position is always upper left corner when using SHIFT+CRTL+F10

NOTES:
#9574 #9575 #9576 are all valid bugs (if SHIFT+F10 is allowed in CKE 4.0)
As for my last comment, I have opened new ticket for it - #9583.

Last edited 11 years ago by Jakub Ś (previous) (diff)

comment:6 in reply to:  5 Changed 11 years ago by Satya Minnekanti

Replying to j.swiderski:

@satya both SHIFT+F10 and SHIFT+CRTL+F10 work in editor - my bad.

The problem is that menu position is always upper left corner when using SHIFT+CRTL+F10

NOTES:
#9574 #9575 #9576 are all valid bugs (if SHIFT+F10 is allowed in CKE 4.0)
As for my last comment, I have opened new ticket for it - #9583.

@j.swiderski look at the Accessibility Instructions dialog(To get it press Alt + Zero by keeping cursor in Editor body), It says Press SHIFT+CTRL+F10 to open Editor Context Menu.

comment:7 Changed 11 years ago by Jakub Ś

Docs are one thing, how it currently works is another. CKEditor 3.x has written SHIFT+F10 a11yhelp while both options works there (With some exceptions - E.g. chrome).
Perhaps this is backwards compatibility.

Would be nice if someone else from CKSource team could comment on it.

comment:8 Changed 11 years ago by Garry Yao

Component: GeneralUI : Context Menu
Owner: set to Garry Yao
Status: confirmedreview

Opened review 5acb03c for the contextmenu opening position.

comment:9 Changed 11 years ago by Piotrek Koszuliński

Status: reviewreview_failed

Issues:

comment:10 Changed 11 years ago by Piotrek Koszuliński

I closed #9538 and #9574 as DUPs of this issue. This one should target all cases - context menu on image, collapsed, !collapsed selections on all browsers when opening context menu with SHIFT+F10 or Application keys. Only if that won't be possible to fix all these cases at once we'll create ticket chosen cases.

Last edited 11 years ago by Piotrek Koszuliński (previous) (diff)

comment:11 Changed 11 years ago by Piotrek Koszuliński

Summary: Context menu not displayed in correct position when invoked using keyboard shortcut (Shift + Control + F10)Context menu not displayed in correct position when invoked using keyboard shortcut (Shift + F10 or application key)

comment:12 Changed 11 years ago by Piotrek Koszuliński

Detailed issues list (on git:​5acb03c)

  1. Chrome+Firefox+Opera, opening by app key on selected image with float:right - incorrect place.
  2. Chrome, opening by shift+f10 on collapsed selection - incorrect place (unstable - depends on place in text - sometimes it works).
  3. Firefox, opening by app key on not collapsed selection - incorrect place.
  4. Firefox, opening by shift+f10 opens also native context menu.
  5. IE9, opening by app key - always incorrect place.
  6. IE9, opening by shift+f10 on image - incorrect place.
  7. Opera, opening by shift+f10 on selected image with float:right - incorrect place.
  8. Opera, opening by shift+f10 on collapsed selection - incorrect place.
  9. Opera, opening by shift+f10 sometimes opens only native context menu.

I saw in some tickets that some of these cases cannot be fixed because of browsers' issues, but it'd be nice to have list of all of them in one place.

comment:13 Changed 11 years ago by Olek Nowodziński

Owner: changed from Garry Yao to Olek Nowodziński
Status: review_failedassigned

comment:14 Changed 11 years ago by Olek Nowodziński

Status: assignedreview

Rebased branch on latest master.

Pushed tiny fix commit that provides fair functionality for Chrome, latest Firefox and IE8. Moreover:

  • Firefox 3.x: Browser doesn't support getClientRects and getBoundingClientRect on range objects. These work with DOM elements but range support has been implemented in 4.x. The only reasonable (yet dirty) fix is complete editable cloning, dummy element insertion and calculating position.
  • Opera: selection.getNative() is broken. Sometimes editor.getSelection().getNative() != editor.document.getWindow().$.getSelection(). Also some issues with getClientRects and getBoundingClientRect.
  • IE10: Feature broken with floated image (error thrown).
  • IE9: Weird implementation of getClientRects and getBoundingClientRect.
  • IE7: Rects work but menu positioning is broken.

Anyway:

I don't we think we can have this feature working on all browsers if we consider the variety of issues. We can try to fix them one-by-one and at least bring accessibility to IE9.

comment:15 in reply to:  14 Changed 11 years ago by Piotrek Koszuliński

Replying to a.nowodzinski:

Possible bug in core/selection. = instead of == ?

return ( this._.cache.nativeSel = isMSSelection ? this.document.$.selection : this.document.getWindow().$.getSelection() );

It's ok - this is intended assignment, not a broken comparison.

PS. there's a coding style issue in https://github.com/cksource/ckeditor-dev/commit/fd35c9e43c83d711357ebc6e011a1c563086cbc2#L0R163

comment:16 Changed 11 years ago by Piotrek Koszuliński

Status: reviewreview_failed

This is still pretty broken. I can't even find what was fixed on t/9361 - I see similar (equally unstable) results on master.

In my opinion, if it's impossible to fix majority of cases by decent, readable and maintainable patch, then it's a waste of time. I'd rather go different way - IMO it's better to open context menu always in the top left corner or centre of the viewport unless it's opened by mouse right click. At least it will be predictable.

comment:17 Changed 11 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.0.1

This issue revealed to be way too complex too deal with, with minimal evident benefits. We'll take more time to discuss further about the real need of it as well as for having a clear evidence of the need to have it fixed.

comment:18 Changed 11 years ago by Irina

Cc: irinauru@… added

It is especially bad when you have a large amount of content in the editor for example: when autogrow is enabled or in the Massive inline editing sample.

Steps to reproduce:

  • Open Massive inline editing or autogrow samples.
  • Enter enough content in an editor so that editor grows larger than the current view port and the top of the editor goes off screen.
  • Use the keyboard shortcut to open the context menu: Ctrl+Shift+F10

Problem:

Context menu can not be seen. Focus goes to the context menu and user is not aware of this.

comment:19 Changed 11 years ago by Jakub Ś

#10531 was marked as duplicate.

From CKE 4.0 context menu appears outside of content area.

comment:20 Changed 11 years ago by Wiktor Walc

#10621 was marked as duplicate.

comment:21 Changed 10 years ago by Mike Gifford

How do I replicate this problem on a Mac?

comment:22 Changed 10 years ago by Piotrek Koszuliński

I think that it's impossible to open ctx menu using keyboard on Mac without some tinkering: http://superuser.com/questions/662175/context-menu-right-click-keyboard-shortcut-in-mac-os-x

comment:23 Changed 8 years ago by Piotrek Koszuliński

I think that it's impossible to open ctx menu using keyboard on Mac without some tinkering: ​http://superuser.com/questions/662175/context-menu-right-click-keyboard-shortcut-in-mac-os-x

I'm not sure what I meant by this comment because now I'm able to open the ctx menu using Shift+F10 (may need Fn to be pressed as well) in Chrome@MacOS.

Edit: It was a temporary lack of caffeine in the blood. Of course Shift+F10 won't open the native context menu.

Last edited 8 years ago by Piotrek Koszuliński (previous) (diff)
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