the shown itemname should be the one from the colorpicker item
should open the popup when clicking on the color field
This seems no hard work, but to be honest I don’t know exactly where to start.
I’ve done some custom widgets already but I want an exact copy of the original only with other functionality, and that’s where I’m struggeling.
questions:
what widget type should I use
how can I bind the original colorpicker without the switch
is it possible to use the standard switch for the widget
what is the easiest way to align the single parts (I was thinking of absolute position top/right for colorpicker & switch, and top/left for icon & name)
I think many users have a usecase for something like this.
Maybe there are some experienced users here to help me out to reach my goal?
This will be the beginning of separating the colorpicker and the toggle because you can then just add the toggle in yourself again but with full control over its configuration.
It’s always easiest to let the system do as much of the alignment work as possible. Setting absolute positioning should really be a last resort because it will not be responsive at all and you element will probably look a little different on every single screen.
Most of the oh components already use flexbox alignment so to replicate what your seeing you’ll want to do the same:
thanks again… I made a mistake, I thought =props.colorItem would display the item label but it displays only the name… I searched the docs an forums but can’t find an answer… also tried to use =props.colorItem.label but nothing is displayed. Is there a documentation where this is explained?
Edit: I added additional props for the label… but still searching for a solution for automatic labeling
You actually found the best solution. There is no access to the label of an item directly in the widget expressions. The only way to do it actually through an oh-repeater that you through some trick or other get to return only a single item because that returns a complete item object that includes the label.