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 to Clipboard button not working on supporters page. #406

Closed
mauromsl opened this issue Nov 6, 2024 · 2 comments · Fixed by #408 or openlibhums/consortial_billing#85
Closed
Assignees
Labels
bug Something isn't working

Comments

@mauromsl
Copy link
Member

mauromsl commented Nov 6, 2024

Describe the bug
When using the Copy to Clipboard function on the recommend-us page, it doesn't do anything, other than change its text to "Copied"

To Reproduce
Steps to reproduce the behavior:

  1. Go to recommend-us
  2. Complete the form for a new institution
  3. When the email text is presented, use the copy to clipboard function
  4. Inspect your clipboard or try to paste

Expected behavior
Clipboard should be populated. In case of an error, it should be logged to console rather than swallowed.

Screenshots
image

Desktop (please complete the following information):
System A

  • OS: Arch Linux
  • Browser Firefox
  • Version: Mozilla Firefox for Arch Linux 132.0
    System B
  • OS: Windows
  • Browser: Chrome
  • Version: 130.0.6723.84
@mauromsl mauromsl added the bug Something isn't working label Nov 6, 2024
@StephDriver
Copy link
Contributor

confirmed as replicated on MacOS with Chrome. (ie. not copied to clipboard)

Also, once copied, the button turns to 'copied' and doesn't work a second time - this is not helpful A11y wise, it is important that someone can do the same action again if for some reason they've then been interrupted before pasting.

I suggest instead of copy -> copied have copy-> copy again

@joemull
Copy link
Member

joemull commented Nov 7, 2024

Confirmed with a discussion with Mauro and Steph that this was actually a mismatch between user expectation (that it pastes in places where plain text is supported, including a URL bar or a code editor), and design (that it pastes where html is supported, like an email editor window), as well as an apparent side effect on Arch Linux, where the clipboard manager does not recognize HTML copy events.

Proposed solutions

  • Use plain text, which has the advantage of working everywhere and allowing sender and recipient to examine full hyperlinks.
  • Update the setting text to use plain text in openlibhums/consortial_billing
  • As Steph suggests, also change the copy button text on copy to "copy again"
  • Handle repeated clicks on the button through if blocks, not try / catch, for clarity

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
3 participants