GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): a click outside the scheduled task editor no longer discard… · pingdotgg/t3code@c9e9e7d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components/settings
    • ScheduledTasksSettings.browser.test.tsx
    • ScheduledTasksSettings.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/settings/ScheduledTasksSettings.browser.test.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/settings/ScheduledTasksSettings.browser.test.tsx
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,18 @@ describe("ScheduledTasksSettings", () => {
279279
await expect.element(dialog.getByRole("heading", { name: "New task" })).toBeInTheDocument();
280280
await expect.element(name).toHaveValue("My draft");
281281
});
282+
283+
it("keeps a new task's draft when the user clicks outside the editor", async () => {
284+
setup();
285+
await using _screen = await render(<ScheduledTasksSettings />);
286+
await userEvent.click(page.getByRole("button", { name: "New task" }));
287+
const dialog = page.getByRole("dialog");
288+
const name = dialog.getByRole("textbox", { name: "Name" });
289+
await userEvent.fill(name, "My draft");
290+
291+
await userEvent.click(document.body, { position: { x: 1, y: 1 } });
292+
293+
await expect.element(dialog).toHaveAttribute("data-open");
294+
await expect.element(name).toHaveValue("My draft");
295+
});
282296
});
Collapse file

‎apps/web/src/components/settings/ScheduledTasksSettings.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/settings/ScheduledTasksSettings.tsx
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,8 @@ function ScheduledTaskEditorDialog({
12701270
return (
12711271
<Dialog
12721272
open
1273+
// A stray click outside would discard the unsaved draft; Escape and Cancel still close it.
1274+
disablePointerDismissal
12731275
onOpenChange={(open) => {
12741276
if (!open && !saving) onClose();
12751277
}}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.