Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inputbox onTriggerButton() event #13207

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/common/quick-pick-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export namespace QuickInputButton {
}

export interface QuickInputButtonHandle extends QuickInputButton {
index: number; // index of where they are in buttons array if QuickInputButton or -1 if QuickInputButtons.Back
handle: number; // index of where the button is in buttons array if QuickInputButton or -1 if QuickInputButtons.Back
}

export enum QuickInputHideReason {
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-ext/src/plugin/quick-open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ export class QuickOpenExtImpl implements QuickOpenExt {
async $acceptOnDidTriggerButton(sessionId: number, btn: QuickInputButtonHandle): Promise<void> {
const session = this._sessions.get(sessionId);
if (session) {
if (btn.index === -1) {
if (btn.handle === -1) {
session._fireButtonTrigger(QuickInputButtons.Back);
} else if (session && (session instanceof InputBoxExt || session instanceof QuickPickExt)) {
const btnFromIndex = session.buttons[btn.index];
session._fireButtonTrigger(btnFromIndex as theia.QuickInputButton);
const btnFromHandle = session.buttons[btn.handle];
session._fireButtonTrigger(btnFromHandle as theia.QuickInputButton);
}
}
}
Expand Down
Loading