Results 1 to 1 of 1

Thread: MS Edge support - Contextual menu opening while scrolling

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2015
    Posts
    4
    Vote Rating
    0
      0  

    Default MS Edge support - Contextual menu opening while scrolling

    On MS Edge, the contextual menu opens when a long mouse click is detected (even with the left button).
    This typically occurs while scrolling, which is a problem.
    As a workaround, we have overridden protected void onTouch(Event event) {} on the widget (empty implementation).
    Is there a better way to handle this case?
    Could this be fixed in next version?

  2. #2
    Sencha User
    Join Date
    Nov 2015
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Overriding onTouch(Event event) {} has some side-effects, so I implemented a cleaner workaround as below (class extending Grid)):
    private boolean fixContextMenuGestureRecognizer=false;

    @Override
    public void setContextMenu(Menu menu) {
    fixContextMenuGestureRecognizer=true;
    try {
    super.setContextMenu(menu);
    } finally {
    fixContextMenuGestureRecognizer=false;
    }
    }
    @Override
    public void addGestureRecognizer(GestureRecognizer gestureRecognizer) {
    if (fixContextMenuGestureRecognizer){
    gestureRecognizer = new LongPressOrTapGestureRecognizer() {
    @Override
    protected void onLongPress(TouchData touchData) {
    super.onLongPress(touchData);


    // we do not want to show context menu on right click
    // we could also test isMSEdge, not sure what is best here
    if (GXT.isDesktop()){
    onClick((Event) touchData.getLastNativeEvent());
    } else {
    onRightClick((Event) touchData.getLastNativeEvent());
    }
    }


    @Override
    public boolean handleEnd(NativeEvent endEvent) {
    // onRightClick does preventDefault and stopPropagation
    cancel();
    return super.handleEnd(endEvent);
    }
    };
    }

    super.addGestureRecognizer(gestureRecognizer);
    }

Similar Threads

  1. Replies: 2
    Last Post: 21 Sep 2015, 10:56 AM
  2. Replies: 1
    Last Post: 5 Oct 2011, 8:02 AM
  3. Gridpanel + Menu (contextual)
    By maquejp in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 27 Nov 2009, 5:25 AM
  4. contextual menu on grid- how to keep it all visible?
    By lkasdorf in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 1 Apr 2008, 6:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •