Skip to content

Commit

Permalink
feat(popup): is now accessible by keyboard tabbing
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Dec 20, 2023
1 parent af6d78f commit 3649da0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/editor/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const FootnoteElement = (props) => {
const { data = {} } = element;
const { uid, zoteroId } = data;
const editor = useEditorContext();
const ref = React.useRef(null);

const initialFormData = useSelector((state) => state?.content?.data || {});
const blockProps = editor?.getBlockProps ? editor.getBlockProps() : null;
Expand Down Expand Up @@ -83,15 +84,20 @@ export const FootnoteElement = (props) => {
return (
<>
{mode === 'view' ? (
<span id={`ref-${uid}`} aria-describedby="footnote-label">
<span id={`ref-${uid}`} aria-describedby="footnote-label" ref={ref}>
<Popup
position="bottom left"
pinned={true}
mountNode={ref.current}
on={['click', 'hover', 'focus']}
trigger={
<span
id={`cite_ref-${uid}`}
{...attributes}
className="citation-item"
data-footnote-indice={citationIndice}
tabIndex={0}
role={'presentation'}
>
{children}
</span>
Expand Down

0 comments on commit 3649da0

Please sign in to comment.