Set property to true/false by expression not possible

Hey @Oliver2

first of all, thank you - I’ve learned something that I wasn’t aware of until I read your question.
I thought it won’t be possible currently to open/close popups or popovers depending on item states - now I know, it is. :slight_smile:

Sadly the popover seems to have some problems finding the element (which the class is applied to) if the item is triggered via item state - so it will open at the 0,0 location (top left corner) of the screen, if no action was triggered from the action element before.

But popups for example, would work flawlessly here.
Be aware, that the action will only trigger if the item value changes and not if the item gets update to the same value over and over again

uid: PopoverTest
component: f7-block
slots:
  default:
    - component: oh-button
      config:
        action: popover
        text: Testbutton
        popoverOpen: .testpopover
      slots:
        default:
          - component: f7-popover
            config:
              opened: '=(items.testItem.state === "1") ? true : false'
              class: testpopover
            slots:
              default:
                - component: oh-label-card
                  config:
                    title: TestPopover

btw: Maybe this was your intention here - with this mechanic, you’d be able to find a solution for the question we discussed here

1 Like