Navigation Link: Add opensInNewTab to resetAll#70717
Navigation Link: Add opensInNewTab to resetAll#70717Mamaduka merged 1 commit intoWordPress:trunkfrom
opensInNewTab to resetAll#70717Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| url: '', | ||
| description: '', | ||
| rel: '', | ||
| opensInNewTab: false, |
There was a problem hiding this comment.
Good catch 👍
The issue is that this approach is already not sustainable. Any other props that are added probably will get missed from this list and the same bug will reoccur.
Not blocking on this PR landing but something to consider.
There was a problem hiding this comment.
The issue is that this approach is already not sustainable. Any other props that are added probably will get missed from this list and the same bug will reoccur.
That's kind of the unfortunate deal with attributes. A developer has to cover all the corners when adding a new attribute.
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org>
What?
Follow up of: #67262
Add
opensInNewTab: falseto the default attributes when resetting navigation link fields.Why?
This PR ensures that when navigation link attributes are reset, the
opensInNewTabattribute is also properly reset to its default value offalse.How?
Added
opensInNewTab: falseto the object passed tosetAttributes()in the reset functionality within the Controls component of the navigation-link block. This ensures all navigation link attributes are consistently reset to their default values when the clear action is triggered.Testing Instructions
reset allfunctionality.Screencast
Screen.Recording.2025-07-14.at.5.49.20.PM.mov