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

New links get removed when setting the link to open in a new tab #40892

Closed
joashrajin opened this issue May 6, 2022 · 4 comments
Closed

New links get removed when setting the link to open in a new tab #40892

joashrajin opened this issue May 6, 2022 · 4 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting)

Comments

@joashrajin
Copy link

Description

I am not sure if this is related to #40243 and could not find any other similar reports.

While working on some P2 sites and making alterations, I noticed then whenever I change a link and then set it to open in a new tab, the link that I updated it to is removed. It looks like the changes aren't saved, and when we press 'Open in a new tab' the popup closes and removes any changes we make.

It would be nice if the popup does not close when we press 'Open in a new tab' so that we can press enter to save the link change. This should improve efficiency.

Step-by-step reproduction instructions

  1. Add a link to word a paragraph
  2. Make sure that it is not set to open in a new tab
  3. Try to edit that link and then set it to 'Open in a new tab'
  4. You should then notice that the new link you added was removed and the old one is set

Screenshots, screen recording, code snippet

Screen.Capture.on.2022-05-06.at.16-21-18.mp4

Environment info

  • WordPress 5.9.3
  • Chrome Version 101.0.4951.54 on MacOS 12.3.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@justintadlock justintadlock added the [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) label May 23, 2022
@justintadlock
Copy link
Contributor

I believe what I'm seeing in the video is the "correct" behavior. After editing an existing link, you must either hit the Enter key or click the "submit" (curved arrow) button. Otherwise, the link edit will not take.

Admittedly, this is not particularly evident from the UI and probably needs some refinement.

Can you give it a try while taking the submit action before clicking the "open in new tab" toggle?

@joashrajin
Copy link
Author

Hi @justintadlock 👋

Thank you for looking into this. The Curved Arrow and Enter key does work, but whenever either of them are pressed, the link popup closes, so you need to re-open the popup to set the link to open in a new tab.

To explain my use case, I have a large P2 page with multiple links that aren't set to open in a new tab. I am updating the links and setting them to open in a new tab. With the current way that it works, it means me (1) Updating the Link, (2) Pressing Enter, and (3) Re-opening the link popup to set it to open in a new tab.

It would be nice if this could be adjusted for cases like this - I am sure that many other may also face this problem :)

@justintadlock
Copy link
Contributor

Thanks for the update. It sounds like the issue underneath all of this is that the popup closes after editing the link URL instead of remaining open for edits to other options. Here's an existing ticket for that: #35795

@getdave
Copy link
Contributor

getdave commented Mar 15, 2023

Closing in favour of #43144 as that Issue has more discussion

@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)
Projects
None yet
Development

No branches or pull requests

3 participants