Skip to content

Conversation

@dsriva03
Copy link
Contributor

Fixes #1696

Before

In the Static Formatting Toolbar, after inserting a link the popover remained open.

After
After submitting a URL and pressing Enter, the popover closes and focus returns to the editor.

Change

  • CreateLinkButton.tsx: wrap editLink to call setOpened(false) and editor.focus() after applying the link.

Manual QA

  • Highlight text -> Link -> paste URL -> Enter -> popover closes, link applied.
    Screen Recording 2025-09-10 at 1 29 59 PM
    Note: The demo recording is from my local docs environment (with some examples disabled for testing).
    The change itself is isolated to CreateLinkButton.tsx, no toolbar layout or styling changes were made.

@vercel
Copy link

vercel bot commented Sep 10, 2025

@dsriva03 is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines 135 to 137
update(url);
setOpened(false);
editor.focus();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be within the update callback?

Copy link
Contributor

@nperez0111 nperez0111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really just one line to add

@dsriva03
Copy link
Contributor Author

gotcha! just moved setOpened(false) into update as suggested 👍

@nperez0111 nperez0111 merged commit c7bde94 into TypeCellOS:main Sep 11, 2025
4 of 6 checks passed
@nperez0111
Copy link
Contributor

Thanks for this fix! @dsriva03, appreciate it!

@dsriva03
Copy link
Contributor Author

Happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link popover does not close when using Static Formatting Toolbar

2 participants