-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Toggling "Open in a New Tab" changes URL back to previous link #43144
Comments
Hi, @samxmunoz Do you get the same behavior with and without the Gutenberg plugin active? |
Yep, it'd be great to know that. It should be fixed by #42073. That fix will be in WordPress 6.1, but is already in the Gutenberg plugin. |
This is the exact opposite. The issue described here exists, but it's also true(doesn't keep the edited value) if we have started updating the url and then just click somewhere else and making the LinkControl component unmount. I think this is the intended behaviour and that's why we have the button to 'commit' the changes in the url input. --cc @getdave |
@ntsekouras Oh, I think it's slightly different to what you described. I did misread the steps originally and misinterpreted the video because it shows the other bug. The issue is that when you're typing a URL, if you then click 'Open in New Tab' without submitting, edits to the URL are removed. (after re-reading, this is exactly what was reported 🤦♂️) Still seems to be a bug in Kapture.2022-08-17.at.13.54.43.mp4 |
That's what I said, but it occurs with every attribute change(inspector tools) and if it's unmounted. Screen.Recording.2022-08-17.at.9.58.36.AM.mov |
Ah, ok, I thought you just meant clicking outside the popover. |
Although I can't be 100%, that looks like a customised If you have a clean WP install (no Plugins) does the issue persist. |
Note that I feel that instead of trying to fix individual bugs in individual implementations what we need is to
The vision of the component was that links (and associated metadata) would not be modified until the user clicks the "submit" button. Until that point all changes within the component are saved to local component state. The problem is that we now have toggles such as "open in a new tab" which lie in a gray area. Should the toggles:
I would vote for the later. So the behaviour should be:
I think the core issue is that in certain implementations:
At this point it might be useful to get some input from Design expertise (cc @javierarce and @jasmussen). |
This is a very unique issue, thank you all for the helpful videos demonstrating the main problem: clicking outside the link dialog without applying first acts as a dismissal and doesn't save the value in the URL. The toggle is a light-switch, with immediate effect, i.e. it saves and commits at the same time. As clarified by this ticket, this goes against the intentional dismissal of changes made, by clicking outside. In that light, can we/should we change the toggle to a checkbox, requiring that it also be submitted, otherwise a click outside dismisses it? |
One argument against this is that the submit button is very tied to the URL itself. There is no clear indication that the submit functions for the entire link. Notice how the toggles are divorced from the submit. For this reason I would be concerned that most folks would toggle the checkbox and then click off expecting things to be saved as they were previously with the toggle control. |
Yes, that's a good point indeed. Another option is to remove the toggle from that state entirely, and have it something you are only able to do after the fact, here: To me that seems like a quick and good fix, since opening in new tabs is arguably a pretty bad practice. Another option is to add a cog of "link settings" before the submit button, which either opens a new modal or "slides" the contents of the window rightward, showing additional options. That seems like a lot of work for unclear benefit, though. What do you think? |
I quite like the idea of separating the editing of a link from the changing of settings. We could explore the first option.
I would agree. A lot of work for the potential ROI. |
@jasmussen In light of recent updates to the UI (and the upcoming addition of a settings "drawer") should we consider making any changes to the link require clicking This would eliminate a whole class of bugs but would require the user to know to submit their changes. However with the updates to the UI perhaps this requirement is now a lot more obvious? Also noting this ties in nicely with @joedolson's feedback that all changes should require confirmation. |
No strong opinion here. (Other than that Enter should submit) |
Definitely in favor of requiring confirmation on all changes. |
Now #47328 is merged we can look to make this happen. |
I believe it's fixed by #50401 Need review for the PR please. [note: created the PR in |
This was fixed in #50668 |
Description
Open in a new tab is not working properly for links (tested with inline links & buttons).
You should be able to toggle open in a new tab on and off without it changing the destination URL.
Step-by-step reproduction instructions
The URL will revert back to the original and it requires you to type it again.
Screenshots, screen recording, code snippet
Here is a screen recording:
https://i.getf.ly/v1uOZQGz
Environment info
WordPress 6.0.1
Frost Theme
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
The text was updated successfully, but these errors were encountered: