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

Click on "Open in new tab" control causes hyperlink creation UI popover to close #25946

Closed
Tracked by #35073
getdave opened this issue Oct 8, 2020 · 4 comments
Closed
Tracked by #35073
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Bug An existing feature does not function as intended

Comments

@getdave
Copy link
Contributor

getdave commented Oct 8, 2020

Describe the bug
When creating a link on a portion of text in a paragraph block you may wish for the link to open in a new tab. There is a control in the hyperlink creation popover UI which allows you to toggle this feature on/off. However, when it is clicked the hyperlink creation UI popover closes.

This is undesirable as you may wish to toggle this feature on/off several times or you may have made a mistake. In this case the fact that the UI disappears each time a change is made is quite frustrating. I assume this is due to a re-render of the LinkControl component but I could be wrong.

To reproduce
Steps to reproduce the behavior:

  1. Create new Post
  2. Add some text in a paragraph block
  3. Highlight some of the text and create a link.
  4. Now use the toggle control for "Open in new tab".
  5. Notice how clicking/toggling the control will cause the link UI to disappear.

Expected behavior
The link creation UI should not close when the toggle control is interacted with. It should remain open until it is dismissed.

Screenshots

Screen Capture on 2020-10-08 at 09-27-05

Editor version (please complete the following information):

  • WordPress version: 5.5.1
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Plugin
  • If the Gutenberg plugin is installed, which version is it? 9.9.1

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 85.0.4183.121 (Official Build) (64-bit)
@getdave getdave added [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Bug An existing feature does not function as intended labels Oct 8, 2020
@willRicard
Copy link

Hello, I would very much like to help investigate and/or fix the problem. I can reproduce since I'm running on the same software, I'll update if I find anything.

@willRicard
Copy link

I got to reproduce the bug, now I am in the process of getting the React DevTools to work with Gutenberg to find out what dependency is triggering the close.

@guarani
Copy link
Contributor

guarani commented Oct 19, 2020

FWIW, the modal doesn't close when the "Open in new tab" button is toggled during link creation, only when editing an existing link can I reproduce this bug.

screen recording showing open in new tab not closing modal when link is being added

willRicard added a commit to willRicard/gutenberg that referenced this issue Oct 20, 2020
Clearing the `activeFormats` list on the link value caused the link edit
popover to close.

Reported by Dave Smith <getdavemail@gmail.com>.
Fixes WordPress#25946.
@getdave
Copy link
Contributor Author

getdave commented Mar 15, 2023

Closing in favour of more comprehensive issue in #45741

@getdave getdave closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants