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

"Open in new tab" relationship values are overwritten when user first enters a different relationship value #29690

Closed
skorasaurus opened this issue Mar 9, 2021 · 5 comments
Labels
[Block] Buttons Affects the Buttons Block [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended

Comments

@skorasaurus
Copy link
Member

skorasaurus commented Mar 9, 2021

While reviewing PR #29664 ; I encountered this but it also applicable in Gutenberg.

Description

This is a bit of an edge case, but when a user first enters a valid 'rel' value in the "link rel" field (which is ambiguously named, visit this issue for more information on the ambiguity; and then toggles, the value of the is overwritten.

Step-by-step reproduction instructions

Please list the steps needed to reproduce the bug. For example:

  1. create new page
  2. create a button
  3. enter a link
  4. go to the advanced settings or the link settings of that block's sidebar, enter in a valid 'rel' value. I typed in external in my test cases.
  5. go back to the button, enable the toggle for the "open in new tab"
  6. click publish

Expected behaviour

rel value to the button's link to be noreferrer noopener external

Actual behaviour

the rel's value of the button's link was 'rel="external noopener"

Screenshots or screen recording

The screen recording shows the intended behavior if you

2021-03-08.mp4

I've verified that this behavior occurs both when the user clicks the 'open in new tab' toggle in the sidebar or if they click the toggle in the link UI.

The more important part is that the rel field in the sidebar has values entered in it BEFORE the toggle is clicked.

I am NOT able to reproduce this if you first click the 'open in new tab' toggle and then add an additional rel value into the 'link rel' field (likely because 'external and noopener' are added first).

Also worth noting:

there is a PR to remove the noreferrer value - #26968
so this issue may be moot; I haven't tried if you enter multiple ref value first.
There's an issue to overhaul the entire link UI

WordPress information

  • WordPress version: 5.6.0
  • Gutenberg version: 10.1.1
  • Are all plugins except Gutenberg deactivated? yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? tested on twentytwenty and twentytwentyone.

Device information

  • Device:
  • Operating system:
  • Browser:
@skorasaurus skorasaurus added the [Type] Bug An existing feature does not function as intended label Mar 9, 2021
@talldan talldan added the [Block] Buttons Affects the Buttons Block label Mar 10, 2022
@Mamaduka
Copy link
Member

Hi, @skorasaurus

I'm no longer able to reproduce this issue, at least with the button block.

@Mamaduka Mamaduka added the [Status] Needs More Info Follow-up required in order to be actionable. label May 31, 2022
@skorasaurus skorasaurus added [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later and removed [Status] Needs More Info Follow-up required in order to be actionable. labels May 31, 2022
@skorasaurus
Copy link
Member Author

skorasaurus commented May 31, 2022

Thanks for checking; although I'm still able to reproduce it on gutenberg 13.3.0.

@Mamaduka
Copy link
Member

@skorasaurus, sorry, I think I missed the step in testing. Now I'm also able to reproduce this.

@skorasaurus
Copy link
Member Author

no longer able to reproduce this in gutenberg 17.7.0.

@Mamaduka
Copy link
Member

Mamaduka commented Mar 1, 2024

Thanks for the follow-up, @skorasaurus!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants