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

Footnotes: enlarge rich text footnote target #54119

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -48,7 +48,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
Loading