Skip to content

Commit

Permalink
check isFocusable before focusing to support displayOnlyProperty, #451
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 7, 2025
1 parent b06110c commit 445b94c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/ComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,12 @@ export default class ComboBox<T> extends WidthSizable( Node ) {
this.listBox = new ComboBoxListBox( property, items, nodes,
this.hideListBox.bind( this ), // callback to hide the list box
() => {
this.button.blockNextVoicingFocusListener();
this.button.focus();

// Check that it is focusable, for example, displayOnlyProperty can change that state, see https://github.com/phetsims/sun/issues/451
if ( this.button.isFocusable() ) {
this.button.blockNextVoicingFocusListener();
this.button.focus();
}
},
this.button,
options.tandem.createTandem( 'listBox' ), {
Expand Down

0 comments on commit 445b94c

Please sign in to comment.