Skip to content

Commit

Permalink
Clear name error faster and when the user changes the field
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Apr 16, 2024
1 parent 2a40b38 commit 4c30444
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class GuidedNewDatasetPage extends Page {
const name = this.state.name;
if (!name) {
if (this.#nameNotification) this.dismiss(this.#nameNotification); // Dismiss previous custom notification
this.#nameNotification = this.notify("Please enter a project name.", "error");
this.#nameNotification = this.notify("Please enter a project name.", "error", 3000);
return;
}

Expand Down Expand Up @@ -97,7 +97,12 @@ export class GuidedNewDatasetPage extends Page {
onOverride: (name) => {
this.notify(`<b>${header(name)}</b> has been overridden with a global value.`, "warning", 3000);
},
validateOnChange,
validateOnChange: async (...args) => {
const results = await validateOnChange.call(this.form, ...args)
if (!results && args[0] === "name") this.#nameNotification && this.dismiss(this.#nameNotification);
return results

},
onUpdate: () => (this.unsavedUpdates = true),
onThrow: function (message) {
if (skipError(message)) return;
Expand Down

0 comments on commit 4c30444

Please sign in to comment.