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

Right container node of Menu shows at the left when prefWidth is set via CSS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx23
    • javafx
    • None

      If the pref width of a ContextMenu control is set via CSS, the arrow graphic in the right container of a Menu in the ContextMenu control is wrongly laid out, and shows at the left of the label.

      To reproduce, run the attached test and right click to show the context menu.
      The right arrow is at the left of the label (see the attached "menu with pref width set.png" pic).

      If the pref width is not set:
      .context-menu {
      // -fx-pref-width: 150;
      }
      it works as expected (see the attached "menu without pref width set.png" pic).

      Workaround: set min/max width instead:

      .context-menu {
          -fx-min-width: 150;
      // -fx-pref-width: 150;
          -fx-max-width: 150;
      }

       

            Unassigned Unassigned
            jpereda Jose Pereda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: