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

Adjusting link text and clicking to open in a new tab closes link modal without saving the adjustments #45741

Closed
paaljoachim opened this issue Nov 13, 2022 · 10 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended

Comments

@paaljoachim
Copy link
Contributor

Description

When I open an existing link and adjust the text and then also click Open in new tab the link dialog box suddenly closes without the adjustments being saved.

I have to do two operations.
Open a link and change the link text. Click the enter symbol to close it.

Open the link again and then click the Open in new tab and then click the enter symbol to close it.

Step-by-step reproduction instructions

  1. Create a link.
  2. Open the existing link.
  3. Change the link text.
  4. Click the Open in new tab toggle.
  5. Notice the link modul closes and does not save the changes.

---> It should not close the link modal before I click enter on my keyboard or the enter symbol in the link modal.

Screenshots, screen recording, code snippet

Changing.link.text.and.clicking.open.in.new.tab.closes.link.modul.mp4

Environment info

WordPress 6.1
Gutenberg plugin 14.5
Theme: Twenty Twenty Three

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

@paaljoachim paaljoachim changed the title Bug when adjusting link text and clicking to open in a new tab. Adjusting link text and clicking to open in a new tab closes link modal without saving the adjustments Nov 13, 2022
@paaljoachim paaljoachim added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Nov 13, 2022
@ndiego ndiego added Needs Design Feedback Needs general design feedback. and removed Needs Testing Needs further testing to be confirmed. labels Nov 15, 2022
@ndiego
Copy link
Member

ndiego commented Nov 15, 2022

This issue was reviewed in today's Editor Bug Scrub. I was able to confirm this issue. I do think some design feedback is needed on the correct way to handle this. My thought is toggling the "Open in new tab" should never close the modal. This would require an additional click outside the modal to close, but I think it's unintuitive that toggle the setting auto-closes the modal.

Quick note, this issue also seems related to #35795 and #40892.

@richtabor
Copy link
Member

My thought is toggling the "Open in new tab" should never close the modal.

Agreed.

@paaljoachim
Copy link
Contributor Author

As one has the link modal open and does does various things. It should close on clicking the enter symbol or clicking enter on the keyboard.

My thought is toggling the "Open in new tab" should never close the modal.

I too agree.

@javierarce
Copy link
Contributor

javierarce commented Nov 29, 2022

+1 to prevent closing the modal

I think this is a duplicate of this older issue

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Dec 2, 2022

Thanks for finding that @javierarce ..:)

I noticed that @getdave Dave made the older issue. Perhaps he or someone else might be able to take a closer look.

@getdave
Copy link
Contributor

getdave commented Dec 2, 2022

These issues are likely come increasingly into focus as a result of the work on the Nav block offcanvas experiment.

@hz-tyfoon
Copy link
Contributor

I'm amazed that this issue exists since Oct 8, 2020 and it's not yet fixed.

I spent an almost 1.5 hours of going through all the conversations here and the related issues (#49091) & spent another 2.5 hours reading the codebase and trying to understand it & finally going for a fix.

Created a PR just now to the wp/6.2 branch as the trunk branch's current work isn't merged with WordPress core.
But,
I'd really appreciate for any feedback if any change needed or if anything can be improved.

PR: #50401

@richtabor
Copy link
Member

Accomplishing #50890 will resolve this issue as well.

@getdave
Copy link
Contributor

getdave commented Jun 6, 2023

@paaljoachim Should now be fixed by #50945

@getdave getdave closed this as completed Jun 6, 2023
@paaljoachim
Copy link
Contributor Author

paaljoachim commented Jun 6, 2023

Great! Thanks Dave @getdave !

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) Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants