如果 React-Phone-Input-2 中存在预先存在的值,如何渲染图标或空选择器?
<PhoneNumberInputField
countryCodeEditable={ false }
country={ defaultCountry() }
value={ value }
specialLabel={ translate('profile:profile.phone') }
onChange={ (phoneNumber, data) => handlePhoneChange(phoneNumber, data) }
/>
谢谢!
Is there a way to render an icon or empty selector if a pre-existing value exists in React-Phone-Input-2?
<PhoneNumberInputField
countryCodeEditable={ false }
country={ defaultCountry() }
value={ value }
specialLabel={ translate('profile:profile.phone') }
onChange={ (phoneNumber, data) => handlePhoneChange(phoneNumber, data) }
/>
Right now the first country flag si render in the selector:
And I want something like this if the value exists and no country code is selected:
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
新
当我们使用默认值时,焦点类消失,因此它不显示值。我添加它是为了添加
focused
类。旧:
对我来说,这有效
autoFocus:true
和onFocus
事件有效问题是,它聚焦并显示光标
New
When we a default value, focused class disappeared therefore it don't show value. I added this to add
focused
class.Old:
For me this worked
autoFocus:true
andonFocus
event workedThe issue is, it focus and show curor