浏览代码

docs: improve select F&Q (#1099)

YannLynn 3 年之前
父节点
当前提交
a341d7acc8
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 1 0
      content/input/select/index-en-US.md
  2. 2 0
      content/input/select/index.md

+ 1 - 0
content/input/select/index-en-US.md

@@ -1415,6 +1415,7 @@ MinWidth will be given, but width will not be written dead. If necessary, you ca
     So why is label instead of value in semi's select?  
     The label of the option is what the user perceives. From an interactive point of view, if there are two options that are exactly the same on the display, to the user’s perception, they look the same and cannot be distinguished, but the selected effects are different (for example, one value is 0, the other As 1), it is unreasonable. (Users' first reaction is often repeated, and there may be a bug)
 Unique label and repeated value are more common in daily use. For example, a selector that selects the company id based on the app name, value is the company id corresponding to the app, and label is the name of the app.
+We don't recommend showing the user a duplicate label option, but if you're sure you need to, you can bypass this restriction when you pass a ReactNode type to the label.
 
 - **Why is the blur event not fired after a radio selection option?**
 

+ 2 - 0
content/input/select/index.md

@@ -1472,6 +1472,8 @@ import { Select, Checkbox } from '@douyinfe/semi-ui';
             <Option label='abc' value='bytedance' />
           </Select>
         ```
+    - 分组情况下,重复label并不会造成用户困惑为什么仍要求label必须唯一?
+      - 选择面板打开情况下,确实不会造成用户使用上的困惑,但是选择面板收起后,重复label属于哪个分组对用户而言仍具有迷惑性。
     - 我的数据里确实就有多个 label 一样的选项,无法避免。这个交互能绕过吗?
       - 可以。我们不推荐向用户展示重复的 label option,但如果你确定你需要这么做,当你往 label 传入 ReactNode 类型时,可以绕过这个限制。