ui: Don't add an on_click
handler for disabled ListItem
s (#23569)
This PR updates the `ListItem` component to not register an `on_click` handler for `ListItem`s that are disabled. When working on #23350 I noticed that even when the context menu entry was disabled you could still click on the entry to fire the action. Release Notes: - Fixed some instances of disabled list items still registering clicks.
This commit is contained in:
parent
5ef5b75099
commit
76bf4686ef
1 changed files with 4 additions and 3 deletions
|
@ -245,9 +245,10 @@ impl RenderOnce for ListItem {
|
|||
})
|
||||
})
|
||||
})
|
||||
.when_some(self.on_click, |this, on_click| {
|
||||
this.cursor_pointer().on_click(on_click)
|
||||
})
|
||||
.when_some(
|
||||
self.on_click.filter(|_| !self.disabled),
|
||||
|this, on_click| this.cursor_pointer().on_click(on_click),
|
||||
)
|
||||
.when(self.outlined, |this| {
|
||||
this.border_1()
|
||||
.border_color(cx.theme().colors().border)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue