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

ComboBox is always in focus state

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • 9
    • 8u51
    • javafx
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      Microsoft Windows [Version 6.1.7601]
      Copyright (c) 2009 Microsoft Corporation. All rights reserved.

      c:\_tmp\_cur>java -version
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)



      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      On the same Scene 2 Nodes are focused.
      I have a panel with numerous fields like TextField, ComboBox etc.

      Why I need it?
      I made some decorations depending on the focus status. Method which make decision receive generated Node (we do not know if this is TextField or a TextField inside Pane etc). This method must be universal.

      No matter where is focus ComboBox is always focused - for its descendant ComboBoxListViewSkin$4$1 isFocused() is true

      See below log of descendands

      SimpleName isFocused clazzOfTheNode
      ComboBox false ComboBox@3079560f[styleClass=combo-box-base combo-box]
      StackPane false StackPane[id=arrow-button, styleClass=arrow-button]
      Region false Region[id=arrow, styleClass=arrow]
      true ComboBoxListViewSkin$4$1@2696baaa[styleClass=cell indexed-cell list-cell]'Emil'
      LabeledText false Text[text="Emil", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=System Regular, family=System, style=Regular, size=12.0], fontSmoothingType=GRAY, fill=0x000000ff]




      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create any pane
      2. Add TextField, Add ComboBox
      3. No matter which component you select a TextField, a ComoboBox mentioned ComboBoxListViewSkin$4$1 is always selected.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Only 1 node is focused at the time
      ACTUAL -
      Selected node has focus and all ComboBoxListViewSkin$4$1 components

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      To check if a component is really focused you can do the below check:

       boolean isFocused = aNode.getScene().getFocusOwner() == focusedNode;

            jgiles Jonathan Giles
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: