Skip to content

Commit 28716bb

Browse files
ellatrixtellthemachines
authored andcommitted
Footnotes: enlarge rich text footnote target (#54119)
1 parent 4f71f8e commit 28716bb

File tree

1 file changed

+13
-1
lines changed
  • packages/block-library/src/footnotes

1 file changed

+13
-1
lines changed

packages/block-library/src/footnotes/edit.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,19 @@ export default function FootnotesEdit( { context: { postType, postId } } ) {
4646
return (
4747
<ol { ...blockProps }>
4848
{ footnotes.map( ( { id, content } ) => (
49-
<li key={ id }>
49+
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
50+
<li
51+
key={ id }
52+
onMouseDown={ ( event ) => {
53+
// When clicking on the list item (not on descendants),
54+
// focus the rich text element since it's only 1px wide when
55+
// empty.
56+
if ( event.target === event.currentTarget ) {
57+
event.target.firstElementChild.focus();
58+
event.preventDefault();
59+
}
60+
} }
61+
>
5062
<RichText
5163
id={ id }
5264
tagName="span"

0 commit comments

Comments
 (0)