PhoneInput: hide the country selector when only one country is available #9580
sernstberger
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Version: @mantine/core 9.9.0
What I want
A single-country phone input: formatting mask, no flag/country button, no dropdown.
Proposal
Don't show the country selector when
onlyCountries(orexcludeCountries) leaves a single country. A pickerwith one option does nothing, so nothing is lost and no new prop is needed. The one country is selected even
without
defaultCountry, andleftSectionis free for the app (e.g. a phone icon):Today
The country button is always rendered as
leftSection. PassingleftSectionhappens to replace it (propsreach
InputBasethroughCombobox.EventsTarget), but that isn't documented, andleftSectionPointerEvents="all"and the country width still apply.Related: #9579 (with
international={false},valueshould not include the dial code).All reactions