Skip to content

Commit

Permalink
Merge pull request #4073 from EvanSmith93/fix/floating-link-unfocused
Browse files Browse the repository at this point in the history
fix: focus the editor before opening the floating link toolbar
  • Loading branch information
zbeyens authored Feb 11, 2025
2 parents 0e2b765 + ae51aaa commit f18a21d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-jars-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-link': patch
---

Editor auto focuses when opening the insert link modal
1 change: 1 addition & 0 deletions packages/link/src/react/components/useLinkToolbarButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const useLinkToolbarButton = (
props: {
pressed: state.pressed,
onClick: () => {
editor.tf.focus();
triggerFloatingLink(editor, { focused: true });
},
onMouseDown: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
Expand Down

0 comments on commit f18a21d

Please sign in to comment.