I get the above mentioned message and tried to use sp-picker. That does appear in the interface and even presents the options (sp-menu-item), but it doesn’t do anything when used. The documentation in Spectrum Web Components obviously does not apply for use in InDesign UXP. Has anybody used this succesfully in InDesign?
Update – found the problem
The Spectrum Web Components documentation does not apply to InDesign. Here I have to encapsulate the menu-items into a menu element–then it works like sp-dropdown:
<sp-picker id="my-select-id" size="M">
<sp-menu slot="options">
<sp-menu-item>item 1</sp-menu-item>
</sp-menu>
</sp-picker>
Yes. If I understand it correctly, I have to use React or apply onClick handlers to each menu-item. If that is the solution, I prefer using sp-dropdown as long as possible…
Or I go back to <select>
…
By the way–I don’t like all that Spectrum stuff at all. It would be so much easier to use standard html elements. This is of course possible, but the styling doesn’t fit into the application without lots of css. That is something Adobe could and should correct.
1 Like
I hear you.
The Spectrum stuff was created and implemented for internal use at Adobe, opening it to external developers was, I think, meant to add value, but it wasn’t a top priority.
UXP is “not a browser” by design.
That’s clear. But it uses Chromium and UXP UI is technically an html document. All standard elements are basically supported, as expected. But someone took the decision not ship with Adobe application confirming design, not even offering separate css for this. Instead developers are advised to use Spectrum components and widgets. But not to provide educational and accurate documentation how to do it. This is where things get time-consuming and thus annoying.
Sorry for bothering you here, i should direct that criticism somewhere else…
1 Like