StatusBar onClick not working

HI ,

I am have custom progress statusbarItem

@injectable()
export class CustomProgressStatusBarItem extends ProgressStatusBarItem {
 @inject(BackgroundProcessService) private readonly backgroundProcessService: BackgroundProcessService;

    protected update(progressId: string | undefined): void {
        const message = progressId && this.messagesByProgress.get(progressId);
        if (!progressId || !message) {
            this.statusBar.removeElement(this.id);
            return;
        }
        const text = `$(refresh~spin) ${message}`;
        this.statusBar.setElement(this.id, {
            text,
            alignment: StatusBarAlignment.LEFT,
            priority: 1,
            tooltip: 'Show details',
             onclick: ()=> {
                 this.backgroundProcessService.togglePopover();
             },
        });
    }
}

But due to this change,the event generated on click of statusbar is pointerEvent which is not a MouseEvent. Am I doing something wrong or I need to use CommandId instead of onClick ?

Hmh…first off: MouseEvent is an interface, but interfaces get erased in compilation. So how would this even work. Then: PointerEvent is a sub-interface of MouseEvent, so if the instanceof would work, it would be correct.

In conclusion, this looks like a bug to me, please open an issue. If you have an example, you can share, that would be super.

1 Like

Thanks @tsmaeder , I have filled an issue StatusBar onClick function not called with latest update v1.25.0 · Issue #11116 · eclipse-theia/theia (github.com)