Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

portico: Fix new organization form focus scrolling.

Tim Abbotte560519dba6d
diff --git a/web/src/portico/signup.ts b/web/src/portico/signup.ts
index 97d4b634236..7a913b51e41 100644
--- a/web/src/portico/signup.ts
+++ b/web/src/portico/signup.ts
@@ -75,6 +75,11 @@ $(() => {
const $firstInputElement = $("input:not(:hidden, :disabled)").first();
// Focus on the first input field in the form.
$firstInputElement.trigger("focus");
+ // Override the automatic scroll to the focused
+ // element. On the (tall) new organization form, at least,
+ // this avoids scrolling to the middle of the page (past
+ // the organization details section).
+ $("html").scrollTop(0);
} else {
// If input field with errors is present.
// Find the input field having errors and stores it in a variable.