Skip to content

Commit dd87fbf

Browse files
core: fix statusbar onclick
The commit fixes an issue when attempting to perform `onclick` for statusbar items. Previously, the `onclick` check we had would not pass and would therefore fail to execute the `onclick` callback. Signed-off-by: vince-fugnitto <[email protected]>
1 parent df80a99 commit dd87fbf

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/core/src/browser/status-bar/status-bar.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ export class StatusBarImpl extends ReactWidget implements StatusBar {
173173
attrs.onClick = this.onclick(entry);
174174
attrs.className = 'element hasCommand';
175175
} else if (entry.onclick) {
176-
attrs.onClick = e => {
177-
if (entry.onclick && e instanceof MouseEvent) {
178-
entry.onclick(e);
179-
}
180-
};
176+
attrs.onClick = e => entry.onclick?.(e.nativeEvent);
181177
attrs.className = 'element hasCommand';
182178
} else {
183179
attrs.className = 'element';

0 commit comments

Comments
 (0)