Skip to content

Commit

Permalink
Footnotes: enlarge rich text footnote target (#54119)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and tellthemachines committed Sep 5, 2023
1 parent 4f71f8e commit 28716bb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/block-library/src/footnotes/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,19 @@ export default function FootnotesEdit( { context: { postType, postId } } ) {
return (
<ol { ...blockProps }>
{ footnotes.map( ( { id, content } ) => (
<li key={ id }>
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
<li
key={ id }
onMouseDown={ ( event ) => {
// When clicking on the list item (not on descendants),
// focus the rich text element since it's only 1px wide when
// empty.
if ( event.target === event.currentTarget ) {
event.target.firstElementChild.focus();
event.preventDefault();
}
} }
>
<RichText
id={ id }
tagName="span"
Expand Down

0 comments on commit 28716bb

Please sign in to comment.