AdobeDocs / uxp-photoshop

Documentation for UXP Plugin API - Adobe Photoshop 2022 - apiVersion 2
https://developer.adobe.com/photoshop/uxp/2022/
Apache License 2.0
94 stars 96 forks source link

Dropdown example is non-functional #318

Open DianaProbst opened 2 years ago

DianaProbst commented 2 years ago

Issue in /src/pages/uxp/reference-spectrum/User Interface/sp-dropdown.md

DianaProbst commented 2 years ago

`document.querySelector(".yourDropdown").addEventListener("change", evt => {

console.log(`Selected item: ${evt.target.selectedIndex}`);

})`

is given as an examples, but ".yourDropdown" is not defined anywhere in the details above, and no matter how I add IDs, or look for classes, I just can't find out where it should go. No matter what I do, I'm getting Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') as an error.

As an aside, there's no indication of how a querySelector should work, which may be a valid choice, but as someone new to this means I have a whole lot of extra tabs to open, and an inline link to what a querySelector is and does would be great. That's not the main issue, though.

DianaProbst commented 2 years ago

(This took me about half an hour to comb through, until I found the correct inheritance and combo of selectors. That could be cleared up.)

JimaDobes commented 2 years ago

Thanks @DianaProbst this is super helpful. We will (at some point) try to get this resolved and appreciate your debugging. There's a bit of conflation between the template we draw from and our repo which we'll try to sort out before resolving this.