-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buttons: Preserve styling from adjacent button blocks when inserting …
…a new button block (#37905) * Buttons: Attempt to grab attributes from existing button blocks when inserting a new button block * Move logic to get attributes from adjacent block to the inserter * Clean up unneeded changes * Fix regression with Navigation blocks * Add extra inline comment about setting default attributes * Refactor the directInsertBlock to be an object instead of an array, add attributesToCopy prop * Remove innerBlocks from createBlock function call * Allow directInsertBlock attributes to override adjacent block attributes * Fix regression with navigation block inserter * Swap order of attributes for createBlock, add extra Button attributes to copy * Move logic to copy attributes to the getAdjacentBlockAttributes function * Switch attributesToCopy to be an array of strings
- Loading branch information
1 parent
5e0987a
commit df341a8
Showing
6 changed files
with
124 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters