Input: Fix margins when not using prefix/suffix (#43726)

This commit is contained in:
Giordano Ricci 2022-01-06 14:27:27 +01:00 committed by GitHub
parent c8e7368ea6
commit 0013eb3555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,8 +58,8 @@ export const Input = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
className={styles.input}
{...restProps}
style={{
paddingLeft: prefixRect ? prefixRect.width + 12 : undefined,
paddingRight: suffixRect && (suffix || loading) ? suffixRect.width + 12 : undefined,
paddingLeft: prefix ? prefixRect.width + 12 : undefined,
paddingRight: suffix || loading ? suffixRect.width + 12 : undefined,
}}
/>