How to prevent event bubbles in Nicegui? #3805
Replies: 3 comments 3 replies
-
Where is pic? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
-
with ui.button('Item').classes('w-96') as button:
button.on_click(lambda :ui.notify('button'))
ui.space()
icon = ui.icon('delete').classes('z-0')
icon.on('click',js_handler='(e)=>{e.stopPropagation()}')
icon.on('click',lambda :ui.notify('icon')) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Autism-al
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I hope that clicking on an icon in a button only triggers the click event of that icon and not the click event of the button. Just like in the picture, when I clicked the delete icon, I hoped the buttons wouldn't be clicked together, and I didn't seem to find a solution in the document
![Uploading QQ图片20240929120140.png…]()
Beta Was this translation helpful? Give feedback.
All reactions