react-component / select

React Select
https://select.react-component.now.sh/
MIT License
892 stars 451 forks source link

当value 没有 label 属性时,并且options 不包含 value 时,应当将 value 作为 label #1028

Open xulingling0 opened 4 months ago

xulingling0 commented 4 months ago

复现demo:

https://codesandbox.io/p/sandbox/amazing-ace-jvdx6j?file=%2FApp.tsx%3A46%2C30

复现步骤:

第一步: 设置 value 包含 label

  <Select value={{value: 'test', label: 'custom text'}} />

第二步:更新value 为 简单类型

  <Select value={'test'} />

预期表现:

第二步后,选择器内文字为 test

实际表现

第二步后,选择器内文字为上一次缓存的文案 custom text