Button on oh-cell based widget doesn't work

I’m trying to extend the base oh-cell component into custom widget, where I would like to have two separate item states with two different actions configurable for each item.

image

I had something similar created in past, but it was based on f7-card and tried to pretend it was a regular cell. But my css styling was not perfect so it never looked like I wanted on different mobile/desktop browsers.

So I’m now trying to rewrite this widget to be based on oh-cell. I’ve been able to create a widget, but when I tried to test it I found out that the oh-buttons used for actions doesn’t work. It seems like one of cell’s components is preventing the click events to reach the button elements. I tried to fiddle with the z-axis, but nothing helps. When I try to change the base component from oh-cell to f7-card then the button works normally.

Here is very simple example of what I’m trying (for simplicity I removed other components and only left one button):

uid: test-oh-cell-with-button
tags: []
props:
  parameters:
    - context: item
      description: A temperature item
      label: Temperature Item
      name: temp_item
      required: false
      type: TEXT
      groupName: tempAction
  parameterGroups:
    - name: tempAction
      context: action
      label: Temperature
timestamp: Feb 13, 2025, 9:54:41 PM
component: oh-cell
config:
  trendItem: =props.temp_item
slots:
  header:
    - component: oh-button
      config:
        actionPropsParameterGroup: tempAction
        style:
          background: lightgrey
        text: =@props.temp_item

Does anybody know what to do so the button works normally in the cell body?

change the header slot to background slot.
At least this is working for me

I wanted to retain the trend line behaviour of the oh-cell.
If buttons in header slot will not work, I could try with background slot + adding my own oh-trend functionality.

I double checked with my working oh-cell. If I move the oh-button into the header slot it is definitely not working.

EDIT:
You could add a separate oh-trend control to the background slot - I guess…
Never worked with trend lines so I have no experience

I tried to move the content to background slot and added oh-trend and now buttons works properly.
But the styling is completely different:

image

But I think I could solve the styling problem much easier than the not-working buttons. Will give it a try tomorrow. Thanks for the tip with background slot.

I added a block as a container for the whole background slot to control margin, color etc.

slots:
  background:
    - component: f7-block
      config:
        style:
          background-color: rgb(142, 142, 147, 0.5)
          display: flex
          height: 120px
          margin: 0
          padding: 0px
      slots:
        default:

With background slot I was able to finish the widget.

image

Here is how the final widget code looks like, if someone is interrested:

uid: temp_hum_cell
tags: []
props:
  parameters:
    - description: Title of the widget
      label: Title
      name: title
      required: false
      type: TEXT
    - description: Background color
      label: Color
      name: bgcolor
      required: false
      type: TEXT
    - description: Cell icon
      label: Icon
      name: icon
      required: false
      type: TEXT
    - description: Footer
      label: Footer
      name: footer
      required: false
    - context: item
      description: A temperature item
      label: Temperature Item
      name: temp_item
      required: false
      type: TEXT
      groupName: tempAction
    - context: item
      description: A humidity item
      label: Humidity Item
      name: hum_item
      required: false
      type: TEXT
      groupName: humAction
  parameterGroups:
    - name: tempAction
      context: action
      label: Temperature
    - name: humAction
      context: action
      label: Humidity
timestamp: Feb 16, 2025, 3:29:29 PM
component: oh-cell
config:
  class:
    - oh-cell
  expandable: false
slots:
  background:
    - component: oh-trend
      config:
        trendItem: =props.temp_item
    - component: div
      config:
        class:
          - padding
          - list
          - button-header
          - card-opened-fade-out
      slots:
        default:
          - component: f7-row
            config:
              style:
                font-weight: var(--f7-list-media-item-title-font-weight)
                justify-content: start
                padding-bottom: 0.3rem
              class:
                - item-title-row
            slots:
              default:
                - component: oh-icon
                  config:
                    style:
                      margin-right: 5px
                      display: =props.icon?'':'none'
                    icon: =props.icon
                    height: 20px
                - component: Label
                  config:
                    text: =props.title
          - component: f7-row
            config:
              style:
                align-items: center
            slots:
              default:
                - component: f7-col
                  slots:
                    default:
                      - component: oh-button
                        config:
                          actionPropsParameterGroup: tempAction
                          iconColor: "=themeOptions.dark === 'dark' ? 'white' : 'black'"
                          iconF7: thermometer
                          iconSize: 15px
                          small: true
                          class:
                            - no-padding
                          style:
                            color: var(--f7-card-header-text-color)
                            font-size: 13pt
                            font-weight: 500
                            display: flex
                            justify-content: left
                            align-items: baseline
                          text: =@props.temp_item
                      - component: oh-button
                        config:
                          actionPropsParameterGroup: humAction
                          iconColor: "=themeOptions.dark === 'dark' ? 'white' : 'black'"
                          iconF7: drop
                          iconSize: 15px
                          small: true
                          style:
                            color: var(--f7-card-header-text-color)
                            font-size: 13pt
                            font-weight: 500
                            display: flex
                            justify-content: left
                            align-items: baseline
                          class:
                            - no-padding
                          text: =@props.hum_item
                      - component: Label
                        config:
                          class:
                            - item-footer
                          text: =props.footer
                          style:
                            padding-top: .2rem