Skip to content

ui.select .on method duplicates 'popup-hide' event #5079

@ftesser

Description

@ftesser

First Check

  • I added a very descriptive title here.
  • This is not a Q&A. I am sure something is wrong with NiceGUI or its documentation.
  • I used the GitHub search to find a similar issue and came up empty.

Example Code

from nicegui import ui

def on_popup_hide():
    ui.notify('Popup was hidden!', type='info')
    print('Popup was hidden!')

select = ui.select(['A', 'B', 'C'], label='Choose one')
select.on('popup-hide', on_popup_hide)

ui.run()

Description

After a selection is made and the popup is hidden, the application receives two popup-hide events instead of the expected single event.

This issue has been observed in versions 2.23.0 through 2.23.3 and is not present in version 2.22.2.

Here are the log and the screenshot for a single interaction, which show that two events were triggered.

NiceGUI ready to go on http://localhost:8080, http://xx.xx.xxx.xx:8080, http://xx.xx.xx.xx:8080, http://xx.xx.xx.xx:8080, and http://xx.xx.xx.xx:8080
Popup was hidden!
Popup was hidden!
Image

NiceGUI Version

2.23.3

Python Version

Python 3.13.3

Browser

Firefox, Chrome

Operating System

Linux

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    analysisStatus: Requires team/community inputbugType/scope: A problem that needs fixing🟠 majorPriority: Important, but not urgent

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions