< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/skin/ComboBoxListViewSkin.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -174,11 +174,14 @@
         registerChangeListener(control.visibleRowCountProperty(), e -> {
             if (listView == null) return;
             listView.requestLayout();
         });
         registerChangeListener(control.converterProperty(), e -> updateListViewItems());
-        registerChangeListener(control.buttonCellProperty(), e -> updateButtonCell());
+        registerChangeListener(control.buttonCellProperty(), e -> {
+            updateButtonCell();
+            updateDisplayArea();
+        });
         registerChangeListener(control.valueProperty(), e -> {
             updateValue();
             control.fireEvent(new ActionEvent());
         });
         registerChangeListener(control.editableProperty(), e -> updateEditable());

@@ -462,11 +465,11 @@
     private void updateButtonCell() {
         buttonCell = comboBox.getButtonCell() != null ?
                 comboBox.getButtonCell() : getDefaultCellFactory().call(listView);
         buttonCell.setMouseTransparent(true);
         buttonCell.updateListView(listView);
-        updateDisplayArea();
+
         // As long as the screen-reader is concerned this node is not a list item.
         // This matters because the screen-reader counts the number of list item
         // within combo and speaks it to the user.
         buttonCell.setAccessibleRole(AccessibleRole.NODE);
     }
< prev index next >