-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(PhoneNumber): keep selected countryCode value on blur (#2869)
The change: When the user changes the countryCode value – without making a "selection" – and then the input blurs, it will show the current selected value. This way, it will not be possible to "clear" a country code or add a custom. But that also requires us to deliver all possible available codes. The error rate will be way lower for sure. Now, its more like a Dropdown, but with fee text search ability. Here's [a demo](https://eufemia-git-feat-phone-number-keep-value-eufemia.vercel.app/uilib/extensions/forms/feature-fields/PhoneNumber/demos/).
- Loading branch information
1 parent
de55ca8
commit 7e0f9c5
Showing
3 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/dnb-eufemia/src/extensions/forms/Field/PhoneNumber/stories/PhoneNumber.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Field, Form } from '../../..' | ||
|
||
export default { | ||
title: 'Eufemia/Forms/PhoneNumber', | ||
} | ||
|
||
export function PhoneNumber() { | ||
return ( | ||
<Form.Handler onSubmit={console.log}> | ||
<Field.PhoneNumber required validateInitially path="/phoneNumber" /> | ||
<Form.SubmitButton top /> | ||
</Form.Handler> | ||
) | ||
} |