"Open in new tab" relationship values are overwritten when user first enters a different relationship value #29690
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
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:
external
in my test cases.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 - #26968so 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
Device information
The text was updated successfully, but these errors were encountered: