-
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
Feature: Added InnerBlock Support for Download Button & Add Support for download attribute #68510
base: trunk
Are you sure you want to change the base?
Feature: Added InnerBlock Support for Download Button & Add Support for download attribute #68510
Conversation
move: true, | ||
}, | ||
url: href || temporaryURL, | ||
download: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
download
attribute is missing, should we have it added to button component or should we go with a work around here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead with implementing the download attribute on button block for now, I think there is a need for discussion if alternative exists but I feel implementing download attribute is better way to handle this.
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
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. |
@creativecoder @Mamaduka @mikachan Hello! If you could spare some time to review the PR or share your inputs, it would be greatly appreciated. Thank you! |
} | ||
/> | ||
</div> | ||
<InnerBlocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In almost all cases, you want to use useInnerBlocksProps
rather than <InnerBlocks />
these days because that allows you to match the markup between the editor and the frontend (you don't get additional div
elements injected in the editor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for pointing that out. I'll look into updating it to use useInnerBlocksProps!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the code to reflect the changes with useInnerBlocksProps
. Thanks
attempt solution for #57314, #57871
What?
Converting the File block's download button from a RichText component to an InnerBlocks implementation utilizing the core Button block.
Why?
The current RichText implementation limits styling options and creates inconsistency with WordPress's block ecosystem. Users cannot access standard button customization features, and developers face challenges maintaining consistent theme styling. This change improves the user experience while reducing technical complexity.
The migration to InnerBlocks addresses longstanding issues with button customization and brings the File block in line with WordPress's modern block architecture. It enables seamless theme integration and provides users with familiar button controls they expect from the block editor.
How?
The implementation replaces the existing RichText-based button with an InnerBlocks area that specifically allows the core Button block. Key implementation details include:
Testing Instructions
Issues (Identified)
Screencast
Tes.file.innerblock.mp4
Test.button.implementation.mp4