Skip to content

Commit

Permalink
core: pass context to when clause
Browse files Browse the repository at this point in the history
The commit passes the `context` (which is generally assigned to toolbar
items) in order to determine the when clause for toolbar items.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Mar 21, 2023
1 parent 1ca8131 commit 0adf88e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export class TabBarToolbar extends ReactWidget {
}

protected evaluateWhenClause(whenClause: string | undefined): boolean {
return whenClause ? this.contextKeyService.match(whenClause) : true;
return whenClause ? this.contextKeyService.match(whenClause, this.current?.node) : true;
}

protected executeCommand = (e: React.MouseEvent<HTMLElement>) => {
Expand Down

0 comments on commit 0adf88e

Please sign in to comment.