Skip to main content
Participant
March 22, 2024
Question

Dropdownlist clicked in Photoshop is not working

  • March 22, 2024
  • 2 replies
  • 178 views

Hello

 

In Photoshop 25.3.1 (2024)

When we have a DropdownList element and the user click on it, visually the element change.. but on the backend nothing is changing. 

when we have a onChange callback connected, this is not triggered.

 

I did some tests on my end. 

The DropdownList has a "selection" property, that stores the item that is displayed/drew in the UI.

When I change this property by code, then the callback is triggered.

// callback setup
dropdown_list_instance.onChange = function(){alert("Hello world");};

// triggering the callback
dropdown_list_instance.selection = 0;

 

but when we change the dropdownlist from the UI by clicking on any item, then the "selection" property is not change
Example dropdownlist with two elements: "A", "B"


1.- showing dropdown selection property ("A") (By default)

2.- changing the dropdown to "B" in the UI with a click. 

3.- showing dropdown selection property, still getting "A"

 

I hope this helps to solve the bug.

Thanks

2 replies

Legend
July 17, 2025

You are explicitly setting the selection, which is a ListItem. So when you make a selection, you get an alert [which BTW should be Window.alert()] and then the code changes the selection back to 0 (even though 0 is not a ListItem, you should use Listbox.selection.index) so yeah, I'd work on cleaning up your code.

 

What did you expect to happen?

Legend
July 17, 2025

I saw your post and was wondering if you solved the problem? This code behaves as expected:

var dialog = new Window("dialog"),
    dropdown_list_instance = dialog.add("dropdownlist", undefined, ["A", "B"]);
dropdown_list_instance.onChange = function(){alert('idx ' + dropdown_list_instance.selection.index + ' - ' + dropdown_list_instance.selection.text);};
dropdown_list_instance.selection = 0;
dialog.show();

You may be using the selection property incorrectly.