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

feat: dismiss a footnote when touching outside it #1692

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

jminer
Copy link
Contributor

@jminer jminer commented Sep 5, 2023

We have a design for footnotes showing them inline rather than in popovers. You can see an example at https://www.prisonpolicy.org/reports/pie2023.html. When footnotes are shown inline, it makes more sense to leave the footnote open when clicking elsewhere on the page. We used to hack in support to Bigfoot and Littlefoot 3.4 to not close the footnote, but I recently updated the site to use the latest Littlefoot 4.0 (with the code in this PR) and wanted to check your interest in having an option for it. What do you think? If you'd like, I could add some documentation.

Thanks for your work!

@goblindegook
Copy link
Owner

Hi, thanks for your improvement! Can you add a couple of tests to cover this behaviour, please?

This option is especially useful if the footnote is expanded inline
instead of in a popover because then it doesn't make sense to hide it
when clicking another place in the document.
@jminer
Copy link
Contributor Author

jminer commented Sep 27, 2023

Sure, I added some tests and just pushed them.

The first test is testing the behavior of the new setting, and the second and third are the same same other tests and just check that the new setting doesn't change their behavior. Besides the first test, I wasn't sure what to add, but these are what I thought most likely to get broken.

Are these about what you were thinking? I'm happy to change them or add another if you'd like.

@goblindegook
Copy link
Owner

This looks good, thank you!

@goblindegook goblindegook changed the title Add option for whether to dismiss a footnote when touching outside it feat: dismiss a footnote when touching outside it Sep 27, 2023
@goblindegook goblindegook merged commit 49a6157 into goblindegook:main Sep 27, 2023
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 this pull request may close these issues.

2 participants