Skip to content

Commit

Permalink
Add minLength of 3 to make required work
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 12, 2023
1 parent 216c59e commit fb927b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function PhoneNumber(props: Props) {
disabled,
width = 'large',
help,
pattern,

Check failure on line 64 in packages/dnb-eufemia/src/extensions/forms/Field/PhoneNumber/PhoneNumber.tsx

View workflow job for this annotation

GitHub Actions / Run tests and checks

'pattern' is assigned a value but never used
handleFocus,
handleBlur,
handleChange,
Expand Down Expand Up @@ -189,6 +190,7 @@ function PhoneNumber(props: Props) {
disabled={disabled}
width="stretch"
help={help}
minLength={3}
/>
</Flex.Horizontal>
</FieldBlock>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Field } from '../../..'
import { Field, Form } from '../../..'

export default {
title: 'Eufemia/Forms/PhoneNumber',
}

export function PhoneNumber() {
return <Field.PhoneNumber />
return (
<Form.Handler onSubmit={console.log}>
<Field.PhoneNumber required path="/phoneNumber" />
<Form.SubmitButton top />
</Form.Handler>
)
}

0 comments on commit fb927b6

Please sign in to comment.