[Button Block]: Add native mobile support for padding (WIP) #32218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
WIP to add native mobile support for button padding. For ease of testing this PR includes changes to add the block support to the Button block (from #31774)
There were a number of issues with adding native support for padding:
BoxControl
input to allow setting padding for individual sides of the button. This component is not supported natively.Button
is implemented as a class component and must be refactored in order to use the existing utilities fro converting units for mobile.UnitControl
, which I use here as a substitute for theBoxControl
, seems to be lacking some native support -- specifically, thevalue
andunit
have to be handled separately. This vastly complicates the logic needed in an implementation of something likeBoxControl
.This PR:
Button
into a functional componentThe logic in this first pass is overly complicated and essentially re-implements a small subset of the functionality of
BoxControl
. I think the correct approach from here is to abandon this work and focus on getting full native support forBoxControl
.Major Known Issues:
padding
style to the button works, butpaddingTop
for instance does not. Using margin also works.+
and-
controls on theUnitControl
are very buggy ( eg if you click twice it goes from1
to11
)How has this been tested?
Manually. Because this PR refactors the button, all functionality must be tested.
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).