Skip to content

Commit

Permalink
chore: Omit disableUnderline prop for ‘outlined’ variant, because its…
Browse files Browse the repository at this point in the history
… not supported.

The `disableUnderline` prop is only available in the `Input` and `FilledInput` variants, not in `OutlinedInput`.

See docs for reference:
- [FilledInput (filled)](https://mui.com/material-ui/api/filled-input/#props)
- [OutlinedInput (outlined)](https://mui.com/material-ui/api/outlined-input/#props)
- [Input (standard)](https://mui.com/material-ui/api/input/#props)
  • Loading branch information
carlocarels90 committed Nov 20, 2024
1 parent 3f0e88f commit 66b4188
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-goats-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/ecommerce-ui': patch
---

Omit disableUnderline prop for ‘outlined’ variant, because its not supported.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ export function NumberFieldElement<T extends FieldValues>(props: NumberFieldElem

const classes = withState({ size })

let InputPropsFiltered = InputProps

if (variant === 'outlined' && 'disableUnderline' in InputPropsFiltered) {
const { disableUnderline, ...filteredInputProps } = InputPropsFiltered
InputPropsFiltered = filteredInputProps
}

if (required && !rules.required) {
rules.required = i18n._(/* i18n */ 'This field is required')
}
Expand Down Expand Up @@ -114,7 +121,7 @@ export function NumberFieldElement<T extends FieldValues>(props: NumberFieldElem
]}
autoComplete='off'
InputProps={{
...InputProps,
...InputPropsFiltered,
startAdornment: (
<Fab
aria-label={i18n._(/* i18n */ 'Decrease')}
Expand Down

0 comments on commit 66b4188

Please sign in to comment.