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

Automatic Backup: The copy/paste icon in "Save current encryption key" doesn't work! #23414

Closed
3 of 4 tasks
jodomi opened this issue Dec 23, 2024 · 13 comments · Fixed by #23515
Closed
3 of 4 tasks

Automatic Backup: The copy/paste icon in "Save current encryption key" doesn't work! #23414

jodomi opened this issue Dec 23, 2024 · 13 comments · Fixed by #23515
Assignees
Milestone

Comments

@jodomi
Copy link

jodomi commented Dec 23, 2024

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

The copy icon in Save current encryption key doesn't work! Nothing to paste!

Describe the behavior you expected

The copy icon in Save current encryption key works!

Steps to reproduce the issue

  1. Automatic Backup
  2. Configure Automatic Backups
  3. Encryption Key
  4. Change
  5. Click on Copy icon
  6. Paste elsewhere
    ...

What version of Home Assistant Core has the issue?

core 2025.1.0b0

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome est à jour Version 131.0.6778.205 (Build officiel) (64 bits)

Which operating system are you using to run this browser?

Windows 11 23H2

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@silamon silamon added this to the 2025.1 milestone Dec 23, 2024
@bramkragten
Copy link
Member

bramkragten commented Dec 24, 2024

Weird, I can not seem to reproduce this... Do other copy buttons work for you? The new encryption key for example? Or copy button of the entity id in entity settings?

@bramkragten bramkragten mentioned this issue Dec 24, 2024
9 tasks
@jodomi
Copy link
Author

jodomi commented Dec 24, 2024

Still in version 2025.1.0b1, copy/paste OK with "entityID" but "change encryption key" not!

@silamon
Copy link
Contributor

silamon commented Dec 24, 2024

There's a possible fix in 2025.1.0b2.
There was a similar report on discord for the button to not work in the backup onboarding, while it works in the developer tools.

@jodomi
Copy link
Author

jodomi commented Dec 24, 2024

Core 2025.1.0b2: Still no copy with the button (the confirmation message is there!), selecting the new key works and copy/paste with Ctrl+c/Ctrl+v is OK.

@WoBBeLnl
Copy link

Have you enabled the right permissions for the page? AFAIK you can disable/enable those permissions.

Maybe it only works via HTTPS but haven't tested that.

@jodomi
Copy link
Author

jodomi commented Dec 25, 2024

What permission? I can copy and paste (the encryption key for example). I can also copy/paste an entity ID button and I'm not using HTTPS. Firefox or Google Chrome, same battle.

@karwosts
Copy link
Contributor

I can also report it's not working for me.

Every other "Copy to Clipboard" button in the frontend seems to work except this one. My windows clipboard is not modified when I press the button. Maybe something about how it's being used within a dialog makes it different?

@karwosts
Copy link
Contributor

  const el = document.createElement("textarea");
  el.value = str;
  document.body.appendChild(el);
  el.select();
  document.execCommand("copy");
  document.body.removeChild(el);

I will guess that el.select() can't select the element because the dialog is preventing selecting something behind the dialog?

Note that if I highlight some other text in the dialog, and hit the copy button, that highlighted text is copied instead of the key. That suggests that the desired element is actually not being selected.

Not sure why it works for some people.

clipboard

@silamon
Copy link
Contributor

silamon commented Dec 28, 2024

The dialog prevents cancellation, so it will prevent selecting anything outside including the textarea created when navigator.clipboard doesn't work.

@jodomi
Copy link
Author

jodomi commented Dec 29, 2024

Still in version 2025.1.0b3, copy/paste OK with "entityID" but "change encryption key" not!

@silamon
Copy link
Contributor

silamon commented Dec 29, 2024

This issue is still unresolved as long as it is open. Good thing is that the cause is known.

@bramstroker
Copy link

bramstroker commented Dec 29, 2024

I have the same issue in beta 3. Copying using the button doesn't work.
Both from setup screen as "change encryption key" dialog.
Using Macbook Pro. Google chrome 131.0.6778.205
Selecting and just cmd C works fine.

No error in browser developer console.

flash message in the GUI says it is copied.
Screenshot 2024-12-29 at 20 29 20

Will see if I can get some more details when I have some more time.

@bramkragten
Copy link
Member

Not sure why it works for some people.

It will work in a secure context as it then uses the navigator.clipboard API :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants