Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy button doesn't work #2958

Closed
2 tasks done
VNRARA opened this issue Mar 21, 2023 · 5 comments
Closed
2 tasks done

Copy button doesn't work #2958

VNRARA opened this issue Mar 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@VNRARA
Copy link

VNRARA commented Mar 21, 2023

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

Copy button doesn't work when creating API keys.

👟 Reproduction steps

Create key, press copy button

👀 Expected behavior

copy key

😓 Actual Behavior

no copy

🐻 Uptime-Kuma Version

1.21.1

💻 Operating System and Arch

DSM 7.1 (Docker)

🌐 Browser

Version 111.0.5563.65 (Official Build) (64-bit)

🐋 Docker Version

No response

🟩 NodeJS Version

No response

📝 Relevant log output

No response

@VNRARA VNRARA added the bug Something isn't working label Mar 21, 2023
@chakflying
Copy link
Collaborator

chakflying commented Mar 22, 2023

Reproduced this. Here is the summary:

HTTP HTTPS
localhost working not tested
non-localhost not working working

Both the development build and release build, and firefox / edge the failure case exist.
There is too much magic in CopyableInput and I don't really want to figure out what's going on 😅

@louislam
Copy link
Owner

louislam commented Mar 22, 2023

Weird, I re-checked the code, it is basically getting a monitor data from server and fill in the data.
https://github.com/louislam/uptime-kuma/pull/2489/files

Edit: I thought it is the monitor clone button.

@louislam
Copy link
Owner

Can reproduce now with http://non-localhost

But it is still weird, the CopyableInput is working in both https and http in the Push URL (under New monitor -> Push type)

@chakflying
Copy link
Collaborator

chakflying commented Mar 22, 2023

I think according to this StackOverflow being in a modal triggers some enhanced security from the browser. Since our CopyableInput is an actual textfield, maybe we can just use the existing one instead of creating a hidden input to copy from.

@louislam
Copy link
Owner

I think according to this StackOverflow being in a modal triggers some enhanced security from the browser. Since our CopyableInput is an actual textfield, maybe we can just use the existing one instead of creating a hidden input to copy from.

It is only working with textarea, so I move the hidden textarea to the same level instead of creating in the top level of document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants