mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 17:48:07 +00:00
fix(login): Copy to clipboard button in MFA login step now compatible in non-chrome browser (#9880)
related to issue [#9379](https://github.com/zitadel/zitadel/issues/9379)
# Which Problems Are Solved
Copy to clipboard button was not compatible with Webkit/ Firefox
browsers.
# How the Problems Are Solved
The previous function used addEventListener without a callback function
as a second argument. I simply added the callback function and left
existing code intact to fix the bug.
# Additional Changes
Added `type=button` to prevent submitting the form when clicking the
button.
# Additional Context
none
---------
Co-authored-by: Livio Spring <livio.a@gmail.com>
(cherry picked from commit 77b433367e
)
This commit is contained in:
@@ -3,4 +3,4 @@ const copyToClipboard = str => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let copyButton = document.getElementById("copy");
|
let copyButton = document.getElementById("copy");
|
||||||
copyButton.addEventListener("click", copyToClipboard(copyButton.getAttribute("data-copy")));
|
copyButton.addEventListener("click", () => copyToClipboard(copyButton.getAttribute("data-copy")));
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
<div class="lgn-row">
|
<div class="lgn-row">
|
||||||
<span id="secret"> {{.Secret}} </span>
|
<span id="secret"> {{.Secret}} </span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<button id="copy" data-copy="{{ .Secret }}" class="lgn-icon-button">
|
<button id="copy" data-copy="{{ .Secret }}" class="lgn-icon-button" type="button">
|
||||||
<i class="lgn-icon-clipboard"></i>
|
<i class="lgn-icon-clipboard"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user