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

Clicking on documentation website copies the BibTeX example to the clipboard #350

Closed
twhiteaker opened this issue Nov 21, 2019 · 2 comments · Fixed by #351
Closed

Clicking on documentation website copies the BibTeX example to the clipboard #350

twhiteaker opened this issue Nov 21, 2019 · 2 comments · Fixed by #351

Comments

@twhiteaker
Copy link
Contributor

On the documentation website, when I click the Search button, or in the search box, or in the body text of the page, it moves focus to a location just after the Copy BibTeX button and replaces what's in my Windows clipboard with the following text:

@Article{EML_2019,title={Ecological Metadata Language version 2.2.0},url={https://eml.ecoinformatics.org},DOI={10.5063/f11834t2},publisher={KNB Data Repository},author={Jones, Matthew and O’Brien, Margaret and Mecum, Bryce and Boettiger, Carl and Schildhauer, Mark and Maier, Mitchell and Whiteaker, Timothy and Earl, Stevan and Chong, Steven},year={2019}}

Copying the text is what should happen when you click the Copy BibTeX button on the page. However, it's as if the event handler listening for the Copy BibTeX button to be clicked, is actually listening for any part of the page to be clicked. This has these undesired effects when clicking on places besides the Copy BibTeX button:

  1. Unwanted text is copied to the clipboard.
  2. Search functionality is hampered. I cannot click the search box to enter a search term because focus is immediately taken away from it and placed just after the Copy BibTeX button (click the search box, and then press Shift+Tab to see the button get focus).

Note that I can still successfully enter and stay within the Search box if I use the Tab key.

To reproduce the issue:

  1. Put some text in your Windows clipboard, like "Hello World."
  2. Browse to https://eml.ecoinformatics.org.
  3. Click the Search button (magnifying glass icon) at the top.
  4. Paste the contents of your clipboard somewhere other than the current page.
  5. Click in the Search box. Focus is immediately lost.
@mbjones
Copy link
Member

mbjones commented Nov 22, 2019

Good catch, @twhiteaker . The handler for the bibtext button is too broad, and needs to be fixed. PRs would be welcome!

twhiteaker added a commit to twhiteaker/eml that referenced this issue Nov 22, 2019
amoeba added a commit that referenced this issue Nov 26, 2019
Update javascript.html to look specifically for BibTeX button

Fixes #350
@amoeba
Copy link
Contributor

amoeba commented Nov 26, 2019

Reviewed and tested the change. Much appreciated @twhiteaker !

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.

3 participants