Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8226207

CONTEXT_MENU_REQUESTED triggers selection on OS X

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • None
    • jfx12
    • javafx
    • x86
    • os_x

      A DESCRIPTION OF THE PROBLEM :
      This is a follow-up for JDK-8096257 : how to prevent selection using right mouse button in ListView and the like.

      The fix and solution suggested in JDK-8096257 work, but not on OS X. This seems related to event ContextMenuEvent.CONTEXT_MENU_REQUESTED which, on OS X (only ?), triggers a selection of the item.
      FIltering out this event along with MOUSE_PRESSED works, but then, if a context menu was attached to the list cell, the context menu won't show up.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a ListView with a custom list cell.
      In the list cell constructor, filter out the right-click using the code suggested by Jonathan Giles in JDK-8096257.
      Right click on a non-selected list cell.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The context menu should appear and the cell clicked remain unselected.
      ACTUAL -
      The item is selected on OS X.

      FREQUENCY : always


            aghaisas Ajit Ghaisas
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: