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

Pressing copy button twice does not reset to correct text #103

Closed
rowanc1 opened this issue Nov 6, 2020 · 1 comment · Fixed by #107
Closed

Pressing copy button twice does not reset to correct text #103

rowanc1 opened this issue Nov 6, 2020 · 1 comment · Fixed by #107
Labels
bug Something isn't working

Comments

@rowanc1
Copy link
Member

rowanc1 commented Nov 6, 2020

When clicking the copy button twice, it reverts to "Copied!".

This is due to using the last data-tooltip in oldText rather than the localized string.

const temporarilyChangeTooltip = (el, newText) => {
const oldText = el.getAttribute('data-tooltip')
el.setAttribute('data-tooltip', newText)
setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
}

Example:

  • First time, just click once
  • Second time, click twice within 2seconds-- any time after that the hover is "Copied!"

@rowanc1 rowanc1 added the bug Something isn't working label Nov 6, 2020
@welcome
Copy link

welcome bot commented Nov 6, 2020

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

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

Successfully merging a pull request may close this issue.

1 participant