From 75aec434957a89d1ea95a68463e22be52b5d6fcc Mon Sep 17 00:00:00 2001 From: Henning Perl Date: Tue, 12 Dec 2023 18:14:27 +0100 Subject: [PATCH] feat: disable button on click --- src/assets/passwordInput.js | 6 ++++++ src/react-components/ory/user-logout-card.tsx | 1 + 2 files changed, 7 insertions(+) diff --git a/src/assets/passwordInput.js b/src/assets/passwordInput.js index 8876870cc..068cde920 100644 --- a/src/assets/passwordInput.js +++ b/src/assets/passwordInput.js @@ -26,3 +26,9 @@ document.getElementsByName("password").forEach((p) => { }) } }) + +document.querySelectorAll(`*[data-disable-on-click]`).forEach((p) => { + p.addEventListener("click", function () { + p.disabled = true + }) +}) diff --git a/src/react-components/ory/user-logout-card.tsx b/src/react-components/ory/user-logout-card.tsx index 2c78f4a78..8f90ff124 100644 --- a/src/react-components/ory/user-logout-card.tsx +++ b/src/react-components/ory/user-logout-card.tsx @@ -71,6 +71,7 @@ export const UserLogoutCard = ({ type="submit" id="accept" value="Yes" + data-disable-on-click name="submit" variant="semibold" header={intl.formatMessage({