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

Inserting hyperlink through toolbar doesn't open floating editor in edit mode #5372

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -794,11 +794,13 @@

const insertLink = useCallback(() => {
if (!isLink) {
setIsLinkEditMode(true);
editor.dispatchCommand(TOGGLE_LINK_COMMAND, sanitizeUrl('https://'));
} else {
setIsLinkEditMode(false);
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
}
}, [editor, isLink]);

Check warning on line 803 in packages/lexical-playground/src/plugins/ToolbarPlugin/index.tsx

View workflow job for this annotation

GitHub Actions / integrity (18.14.2)

React Hook useCallback has a missing dependency: 'setIsLinkEditMode'. Either include it or remove the dependency array. If 'setIsLinkEditMode' changes too often, find the parent component that defines it and wrap that definition in useCallback

const onCodeLanguageSelect = useCallback(
(value: string) => {
Expand Down