Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ class PhoneInput extends React.Component {
<div
onClick={disableDropdown ? undefined : this.handleFlagDropdownClick}
className={selectedFlagClasses}
title={selectedCountry ? `${selectedCountry.name}: + ${selectedCountry.dialCode}` : ''}
title={selectedCountry ? `${selectedCountry.localName || selectedCountry.name}: + ${selectedCountry.dialCode}` : ''}
tabIndex={disableDropdown ? '-1' : '0'}
role='button'
aria-haspopup="listbox"
Expand Down
15 changes: 15 additions & 0 deletions test/dev_js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,21 @@ class Demo extends React.Component {

<PhoneInput key={this.playgroundKey} {...this.state.playgroundProps}/>
</div>

<div>
<br/><br/>
<p>Example for <a target={"_blank"} href={'https://github.com/bl00mber/react-phone-input-2/issues/456'}>https://github.com/bl00mber/react-phone-input-2/issues/456</a></p>
<p>i18n list of countries, first 3 are in German and the rest is in English</p>
<p>title has local name of the country, or if it's not exist - default one:</p>
<PhoneInput
countries={[{"value":"EG","label":"Ägypten"},{"value":"GQ","label":"Äquatorialguinea"},{"value":"ET","label":"Äthiopien"}]}
enableSearch
localization={{"eg":"Ägypten","gq":"Äquatorialguinea","et":"Äthiopien"}}
onlyCountries={["eg","gq","et","af","ax","al"]}
placeholder={`Select country`}
preserveOrder={['onlyCountries']}
/>
</div>
</div>
)
}
Expand Down