-
Notifications
You must be signed in to change notification settings - Fork 4.7k
InputControl: Decrease large default padding if has prefix/suffix #42166
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
Changes from all commits
ef42dbf
3b0e3ec
1a98f98
8ddc126
edf295b
dc3e9ca
38069ad
8329445
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,13 +40,13 @@ Default.args = { | |
| export const WithPrefix = Template.bind( {} ); | ||
| WithPrefix.args = { | ||
| ...Default.args, | ||
| prefix: <span style={ { paddingLeft: 8 } }>@</span>, | ||
| prefix: <span style={ { marginInlineStart: 8 } }>@</span>, | ||
| }; | ||
|
|
||
| export const WithSuffix = Template.bind( {} ); | ||
| WithSuffix.args = { | ||
| ...Default.args, | ||
| suffix: <button style={ { marginRight: 4 } }>Send</button>, | ||
| suffix: <button style={ { marginInlineEnd: 4 } }>Send</button>, | ||
|
Comment on lines
+43
to
+49
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tweaked examples for better RTL. |
||
| }; | ||
|
|
||
| export const WithSideLabel = Template.bind( {} ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,22 +18,13 @@ type SelectProps = { | |
|
|
||
| type InputProps = { | ||
| disableUnits?: boolean; | ||
| size: SelectSize; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated, but minor cleanup of an unused type. |
||
| }; | ||
|
|
||
| export const Root = styled.div` | ||
| box-sizing: border-box; | ||
| position: relative; | ||
| `; | ||
|
|
||
| const paddingStyles = ( { disableUnits }: InputProps ) => { | ||
| if ( disableUnits ) return ''; | ||
|
|
||
| return css` | ||
| ${ rtl( { paddingRight: 8 } )() }; | ||
| `; | ||
| }; | ||
|
|
||
|
Comment on lines
-29
to
-36
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CSS override removed 🎉 Btw @aaronrobertshaw: When building
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My memory is failing me on this one, I don't recall any blockers. It might have been as simple as I didn't see the It also looks like we might need to tweak the I'd be happy to work on rendering the border control's dropdown as a prefix in a follow up to this PR.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds great, thanks! It's nice to see things getting less hacky as we converge on common patterns 🙂
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've put together a PR (#42212) that now renders the dropdown via the |
||
| const arrowStyles = ( { disableUnits }: InputProps ) => { | ||
| if ( disableUnits ) return ''; | ||
|
|
||
|
|
@@ -58,7 +49,6 @@ export const ValueInput = styled( NumberControl )` | |
| width: 100%; | ||
|
|
||
| ${ arrowStyles }; | ||
| ${ paddingStyles }; | ||
| } | ||
| } | ||
| `; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.