fix(tui): labeled single multi-select Enter as submit
This commit is contained in:
@@ -615,7 +615,7 @@ export class AskDialogComponent implements Component {
|
||||
}
|
||||
const question = this.#questions[this.#currentQuestionIndex()];
|
||||
// Enter advances in multi-question dialogs and submits single-question ones.
|
||||
const enterAction = this.#hasSubmitTab() ? "next" : "submit";
|
||||
const enterAction = this.#questions.length > 1 ? "next" : "submit";
|
||||
const action = question?.multi ? `Space toggle · Enter ${enterAction}` : "Enter select · n note";
|
||||
const tabs = this.#hasSubmitTab() ? " · Tab/←/→" : "";
|
||||
if (this.#questionCanPage && indicator) {
|
||||
|
||||
@@ -622,6 +622,7 @@ describe("AskDialogComponent", () => {
|
||||
onCancel,
|
||||
onPrompt,
|
||||
});
|
||||
expect(render(component)).toContain("Space toggle · Enter next");
|
||||
|
||||
// Space toggles Option A; Enter on the plain option row confirms and
|
||||
// advances to Q2 instead of submitting the whole dialog (#8265 review).
|
||||
@@ -1014,6 +1015,7 @@ describe("AskDialogComponent", () => {
|
||||
onCancel: vi.fn(),
|
||||
onPrompt: vi.fn(),
|
||||
});
|
||||
expect(render(component)).toContain("Space toggle · Enter submit");
|
||||
|
||||
// Space selects Option A; Enter submits right away — no need to
|
||||
// discover the Submit tab (issue #8252).
|
||||
|
||||
Reference in New Issue
Block a user