-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Keep "Open in New Tab" when changing link of Button block. #40244
Conversation
@ddryo Thanks for working on this. Looking at the code, my concern is that this is a bug in |
This reverts commit cd27825.
@talldan I undid the modification on the Button Block side and modified the |
@talldan |
@ddryo thank you for working on this issue. It bothered me since WordPress 5.9. Hope it will be fixed soon |
@ddryo Sorry, I was on vacation (and avoiding github) so couldn't reply to your earlier message.
@getdave I did notice that. There are multiple issues now too. I think whichever one is mergeable first is ok. It looks the @ddryo hasn't addressed some feedback in this PR from @torounit, so it isn't quite ready. |
Just FYI that I will be AFK after today so perhaps @talldan can help with landing one of these? Apologies! |
gutenberg/packages/block-editor/src/components/link-control/test/index.js Lines 2420 to 2423 in cb32e26
The test is failing and needs to be corrected. It would be better to use |
What?
Fix #40243.
Why?
When editing a link in a Button block,
linkTarget
is reset even though only the url is changed.This is a bit strange behavior.
So I created a PR that when only the URL is edited, it does not affect the
linkTarget
that has already been set.How?
WhenopensInNewTab
isundefined
in the information returned byonChange
of<LinkControl>
, the update process oflinkTarget
is not performed.opensInNewTab
was not being passed inhandleSubmit()
of<LinkControl>
.Testing Instructions
Screenshots or screencast
This PR improves the behavior as follows
Kapture.2022-04-12.at.12.09.09.mp4