Popover menu widget - close issue

On my MainUI pages I use a custom menubar widget at the top of every page. It use a popover for navigation to a different page.

  • click on the menu icon
  • select the new page
  • the popover closes and new page is loaded.

After upgrading from 5.0.3 to 5.1.1 this still works but not completely:

Navigation between pages still works. The popover closes visually but is still there. It is listed in the DOM browser. The screen portion which the popover has been used is visible but you can’t klick/use it. So the popover does not correctly close, even it is no longer visible.

This is my widget code

uid: menubar_test
tags: []
props:
  parameters:
    - default: Title
      description: Title
      label: Title
      name: title
      required: false
      type: TEXT
    - default: title
      description: Widget mode
      label: Mode
      name: mode
      required: true
      type: TEXT
      limitToOptions: true
      options:
        - label: Title
          value: title
        - label: Clock
          value: clock
  parameterGroups: []
timestamp: Jan 11, 2026, 9:59:47 AM
component: f7-card
config:
  class:
    - no-padding
    - no-margin
  style:
    background: "#000"
slots:
  default:
    - component: f7-row
      config:
        style:
          border-bottom: "1px dashed #666"
          min-height: 50px
      slots:
        default:
          - component: f7-row
            config:
              visible: =(props.mode === 'title')
            slots:
              default:
                - component: Label
                  config:
                    style:
                      color: lightgray
                      font-size: 35px
                      margin-top: -4px
                      padding-left: 10px
                    text: =props.title
          - component: f7-row
            config:
              visible: =(props.mode === 'clock')
            slots:
              default:
                - component: oh-clock
                  config:
                    format: HH:mm
                    style:
                      color: lightgray
                      font-size: 35px
                      margin-top: -4px
                      padding-left: 10px
                - component: oh-clock
                  config:
                    format: DD.MM.YYYY
                    style:
                      color: lightgray
                      font-size: 20px
                      margin-top: 14px
                      padding-left: 30px
          - component: f7-row
            config:
              style:
                column-gap: 5px
                flex-grow: 1
                justify-content: flex-end
            slots:
              default:
                - component: f7-row
                  config:
                    style:
                      align-items: center
                      height: 40px
                      margin-bottom: 6px
                      margin-top: 4px
                      width: 40px
                  slots:
                    default:
                      - component: oh-link
                        config:
                          action: popover
                          iconColor: gray
                          iconF7: menu
                          iconSize: 25px
                          popoverOpen: .menubar_popover
                        slots:
                          default:
                            - component: f7-popover
                              config:
                                class:
                                  - menubar_popover
                                closeByBackdropClick: true
                                closeByOutsideClick: true
                                closeOnEscape: true
                              slots:
                                default:
                                  - component: oh-list
                                    config: {}
                                    slots:
                                      default:
                                        - component: oh-repeater
                                          config:
                                            accordionList: true
                                            for: rItem
                                            fragment: true
                                            in:
                                              - title: Main
                                                value: main
                                              - title: Test01
                                                value: test01
                                              - title: Test02
                                                value: test03
                                              - title: Test04
                                                value: test04
                                              - title: Test05
                                                value: test05
                                              - title: Test06
                                                value: test05
                                            sourceType: array
                                          slots:
                                            default:
                                              - component: oh-list-item
                                                config:
                                                  action: navigate
                                                  actionPage: ='page:' + loop.rItem.value
                                                  popoverClose: .menubar_popover
                                                  style:
                                                    background: "=(vars.menu === loop.rItem.value) ? '#505050' : ''"
                                                  title: =loop.rItem.title

                                                  

I have already tried to replace oh-list-item with f7-list-button & oh-link. Its the same.

  - component: f7-list-button
    slots:
      default:
        - component: oh-link
          config:
            action: navigate
            actionPage: ='page:' + loop.rItem.value
            popoverClose: .menubar_popover
            style:
              background: "=(vars.menu === loop.rItem.value) ? '#505050' : ''"
            text: =loop.rItem.title
            textColor: white
            href: ""

Does anyone know how to close a popover correctly in OH 5.1.1?

According to the Framework7 docs popoverClose: true is needed in the oh-link and not popoverClose: 'string', see Popover Vue Component | Framework7 Vue Documentation.

florian, thanks for the feedback.

The popoverClose: 'string'adds the data-popover attribute in addition to the popover-close class. It identify which popover to close. But your are right it is not needed here.

If have tested the popoverClose: true with both variants (oh-list-item and f7-list-button/oh-link).
It does not change behavior. :cry:

The popover closes correctly if the action does not navigate to a different page.
Example action: variable instead of action: navigate That’s just to narrow down the problem.

If I use my menu multiple times the popovers are collected on the page:

I have the same effect, when use a popup. But a popup does not interfere with the screen content if it is no longer visible.

I think the system should close the popover/popup first before navigating to a different page.

The following works fine for me:

uid: menubar_test
tags: []
props:
  parameters:
    - default: Title
      description: Title
      label: Title
      name: title
      required: false
      type: TEXT
    - default: title
      description: Widget mode
      label: Mode
      name: mode
      required: true
      type: TEXT
      limitToOptions: true
      options:
        - label: Title
          value: title
        - label: Clock
          value: clock
  parameterGroups: []
timestamp: Jan 11, 2026, 11:53:41 AM
component: f7-card
config:
  class:
    - no-padding
    - no-margin
  style:
    background: "#000"
slots:
  default:
    - component: f7-row
      config:
        style:
          border-bottom: "1px dashed #666"
          min-height: 50px
      slots:
        default:
          - component: f7-row
            config:
              visible: =(props.mode === 'title')
            slots:
              default:
                - component: Label
                  config:
                    style:
                      color: lightgray
                      font-size: 35px
                      margin-top: -4px
                      padding-left: 10px
                    text: =props.title
          - component: f7-row
            config:
              visible: =(props.mode === 'clock')
            slots:
              default:
                - component: oh-clock
                  config:
                    format: HH:mm
                    style:
                      color: lightgray
                      font-size: 35px
                      margin-top: -4px
                      padding-left: 10px
                - component: oh-clock
                  config:
                    format: DD.MM.YYYY
                    style:
                      color: lightgray
                      font-size: 20px
                      margin-top: 14px
                      padding-left: 30px
          - component: f7-row
            config:
              style:
                column-gap: 5px
                flex-grow: 1
                justify-content: flex-end
            slots:
              default:
                - component: f7-row
                  config:
                    style:
                      align-items: center
                      height: 40px
                      margin-bottom: 6px
                      margin-top: 4px
                      width: 40px
                  slots:
                    default:
                      - component: oh-link
                        config:
                          action: popover
                          iconColor: gray
                          iconF7: menu
                          iconSize: 25px
                          popoverOpen: .menubar_popover
                        slots:
                          default:
                            - component: f7-popover
                              config:
                                class:
                                  - menubar_popover
                                closeByBackdropClick: true
                                closeByOutsideClick: true
                                closeOnEscape: true
                              slots:
                                default:
                                  - component: oh-list
                                    config: {}
                                    slots:
                                      default:
                                        - component: oh-repeater
                                          config:
                                            accordionList: true
                                            for: rItem
                                            fragment: true
                                            in:
                                              - title: Main
                                                value: main
                                              - title: Test01
                                                value: test01
                                              - title: Test02
                                                value: test03
                                              - title: Test04
                                                value: test04
                                              - title: Test05
                                                value: test05
                                              - title: Test06
                                                value: test05
                                            sourceType: array
                                          slots:
                                            default:
                                              - component: oh-list-item
                                                config:
                                                  action: navigate
                                                  actionPage: ='page:' + loop.rItem.value
                                                  popoverClose: true
                                                  popoverOpen: true
                                                  style:
                                                    background: "=(vars.menu === loop.rItem.value) ? '#505050' : ''"
                                                  title: =loop.rItem.title

You need both popoverOpen and popoverClose set to true.

With popoverOpen and popoverClosethe behavior is different.

It’s navigate to the new page then it triggers a reload of the page. This reload fix the issue. But on my Raspberry Pi screen this is slow. I have removed the popoverOpenagain.

Thanks anyway for finding this workaround.

All the F7 modal -open or -close properties accept either a boolean or a string with a css selector as values: Link Vue Component | Framework7 Vue Documentation

With the boolean value the action is generic (honestly, I’m not 100% sure how that works with the open event, my guess is it just opens the top example of whatever modal type is being invoked). With the string value the action is specifically targeted to the element indicated by the CSS selector.

The popoverClose: true property works because it is the generic version of the action and closes any open popup. There’s no reason to go back to the specific version, but you could with some tweaks.

The F7 modals are rendered in a high level part of the page, they are not actually “in” the part of the page that shows in the OH page frame. When you first create a page with that modal, My guess is that with the new view update, what is happening is that there is a change in OH page load speed, or a change in the caching of the modals outside of the OH page frame. Whatever the technical reason, by the time your link tries to close the popup with class “menubar_popover” there are now more than one popovers with that class (one from the old page and one from the new page) and it seems that the one that gets the close signal is not the one that is open.

If my guess is correct and you want to be more precise than the general close signal, the way around this with the css selector version of the close property is to make sure the popup has a better way of being uniquely identified by a css selector. Use an additional widget parameter in your menu bar (or use an oh-context to generate a random constant) to give each version of the menu a unique identifier and append that identifier to the popover class (or even better set a popover id with it instead).

From a user standpoint it would only be worth make this change if you ever want to have functional differences in your menubars on different pages, because the popupOpen is going to face the same issue with the non-unique class selector and it’s not clear which popup might be opened if it is a modal caching issue. However it might be a worthwhile experiment to perform just to get a better understanding of the underlying change in the Vue update.

For every page I have already an unique identifier. I use the variable ‘menu’ on every page. With it I can highlight the current page in the popover.
So, I have added this variable to popover class name, popoverOpen, and popoverClose.

current code:

uid: menubar_test
tags: []
props:
  parameters:
    - default: Title
      description: Title
      label: Title
      name: title
      required: false
      type: TEXT
    - default: title
      description: Widget mode
      label: Mode
      name: mode
      required: true
      type: TEXT
      limitToOptions: true
      options:
        - label: Title
          value: title
        - label: Clock
          value: clock
  parameterGroups: []
timestamp: Jan 11, 2026, 8:06:46 PM
component: f7-card
config:
  class:
    - no-padding
    - no-margin
  style:
    background: "#000"
slots:
  default:
    - component: f7-row
      config:
        style:
          border-bottom: "1px dashed #666"
          min-height: 50px
      slots:
        default:
          - component: f7-row
            config:
              visible: =(props.mode === 'title')
            slots:
              default:
                - component: Label
                  config:
                    style:
                      color: lightgray
                      font-size: 35px
                      margin-top: -4px
                      padding-left: 10px
                    text: =props.title
          - component: f7-row
            config:
              visible: =(props.mode === 'clock')
            slots:
              default:
                - component: oh-clock
                  config:
                    format: HH:mm
                    style:
                      color: lightgray
                      font-size: 35px
                      margin-top: -4px
                      padding-left: 10px
                - component: oh-clock
                  config:
                    format: DD.MM.YYYY
                    style:
                      color: lightgray
                      font-size: 20px
                      margin-top: 14px
                      padding-left: 30px
          - component: f7-row
            config:
              style:
                column-gap: 5px
                flex-grow: 1
                justify-content: flex-end
            slots:
              default:
                - component: f7-row
                  config:
                    style:
                      align-items: center
                      height: 40px
                      margin-bottom: 6px
                      margin-top: 4px
                      width: 40px
                  slots:
                    default:
                      - component: oh-link
                        config:
                          action: popover
                          iconColor: gray
                          iconF7: menu
                          iconSize: 25px
                          popoverOpen: ='.menubar_popover_' + vars.menu
                        slots:
                          default:
                            - component: f7-popover
                              config:
                                class:
                                  - ='menubar_popover_' + vars.menu
                                closeByBackdropClick: true
                                closeByOutsideClick: true
                                closeOnEscape: true
                              slots:
                                default:
                                  - component: oh-list
                                    config: {}
                                    slots:
                                      default:
                                        - component: oh-repeater
                                          config:
                                            accordionList: true
                                            for: rItem
                                            fragment: true
                                            in:
                                              - title: Main
                                                value: main
                                              - title: Test01
                                                value: test01
                                              - title: Test02
                                                value: test03
                                              - title: Test04
                                                value: test04
                                              - title: Test05
                                                value: test05
                                              - title: Test06
                                                value: test05
                                            sourceType: array
                                          slots:
                                            default:
                                              - component: oh-list-item
                                                config:
                                                  action: navigate
                                                  actionPage: ='page:' + loop.rItem.value
                                                  popoverClose: ='.menubar_popover_' + vars.menu
                                                  style:
                                                    background: "=(vars.menu === loop.rItem.value) ? '#505050' : ''"
                                                  title: =loop.rItem.title

                                                  

In the browser I can see that there is page-specific class for the menubar_popover.
I really hoped it would work, but unfortunately it doesn’t.

A small recap from my initial post. popoverClose does work partly. The popover is no longer visible, but I can’t click on the OH part behind it.
If I remove popoverClose, the popover stays visible.
It would be good when the popover closes first and then execute the navigating away.

I have found a workaround to properly close a popover when used with a navigate action including the invisible part which blocks the screen.

When I use actionPageTransition the popover is completely removed. Why not without? But this transition adds an additional delay. The speed advantage of OH 5.1 would be lost.

But then I had the idea of disabling the animation. With this combination the issue is gone. :heart_eyes:

actionPageTransition: f7-fade
animate: false
1 Like