kittygiraudel / react-a11y-footnotes Goto Github PK
View Code? Open in Web Editor NEWA reusable React implementation of accessible footnotes.
License: MIT License
A reusable React implementation of accessible footnotes.
License: MIT License
This component is missing types, which is making typescript apps complain. I was thinking about adding them to the DefinitelyTyped repo but maybe you want the types to be here?
First of all, thank you for making this! ❤️
The last FootnoteRef that uses jsx in the description (instead of a string) gets duplicated when clicking on "data-a11y-footnotes-ref" or "data-a11y-footnotes-back-link" (basically when Footnotes is triggered to re-render)
If you customize the Footnotes Wrapper, the component renders multiple times. Which either completely breaks the :target
css selector or makes it behave inconsistently (tested in Chrome, Firefox, and Safari)
I tried looking through the code in this repo, and I imagine this has something to do with the SSR code (registering, cloning, etc.) but I don't know for sure. This is a little over my head right now, so I thought I'd reach out for help.
Using Gatsby cli start a new project gatsby new
Install this package (react-a11y-footnotes
), update the src/pages/index.js
with basic implementation
<FootnotesProvider>
<p>Just <FootnoteRef description="My footnote 1">testing footnotes</FootnoteRef></p>
<p>...and <FootnoteRef description={<>My footnote 2</>}>testing more footnotes</FootnoteRef></p>
{/* <p>some more <FootnoteRef description={<span>My footnote 3</span>}>footnotes</FootnoteRef></p> */}
<Footnotes Wrapper={props => <div {...props} className="footnotes">{props.children} {console.warn('render footnotes')}</div>} />
</FootnotesProvider>
:target
css selector start working again.react-a11y-footnotes/src/index.js
Lines 31 to 33 in 625d76c
here i tried to recreate the problem i had↓
https://codesandbox.io/s/react-a11y-footnotes-forked-23d672?file=/src/App.js
is there a way to dynamically change the list of footnotes when the number of footnotes changes?
https://codesandbox.io/s/react-a11y-footnotes-forked-n6wiv6?file=/src/App.js
Here is an example of such an error.
if you click on toggle, the number of footnotes in the article changes, but the number of references in footnotes does not
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.