Skip to content

Commit

Permalink
fixed disabled toolbar event triggering (#7272)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTomaili authored Oct 24, 2024
1 parent dbc6762 commit e5715e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/corelib/src/ui/widgets/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ToolbarButton(tb: ToolButtonProps): HTMLElement {
const btn = Fluent(
<div class={["tool-button", tb.cssClass, tb.icon && "icon-tool-button", !tb.title && "no-text"]}
title={!!tb.hint && tb.hint} onClick={e => {
if (tb.onClick && !(e.target as Element).classList.contains('disabled')) {
if (tb.onClick && !(e.target as Element)?.closest(".tool-button").classList.contains('disabled')) {
tb.onClick(e);
}
}}>
Expand Down

0 comments on commit e5715e5

Please sign in to comment.