portico: Fix subdomain check flickering with arrow keys.

The previous logic would treat navigating with the arrow keys, or
alt-tab, as a reason to clear the subdomain unavailable warning, and
would not necessarily check again immediately. Now just trigger off
changes in the input.

Instead, just trigger off actual changes in the value of the input.
This commit is contained in:
Tim Abbott 2024-02-07 11:42:18 -08:00
parent e9b0c7f2c0
commit 20d90a6df6
1 changed files with 1 additions and 4 deletions

View File

@ -223,13 +223,10 @@ $(() => {
update_full_name_section();
let timer: number;
$("#id_team_subdomain").on("keydown", () => {
$("#id_team_subdomain").on("input", () => {
$(".team_subdomain_error_server").text("").css("display", "none");
$("#id_team_subdomain_error_client").css("display", "none");
clearTimeout(timer);
});
$("#id_team_subdomain").on("keyup", () => {
clearTimeout(timer);
timer = setTimeout(check_subdomain_available, 250, $("#id_team_subdomain").val());
});