ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
91.93k stars 48.96k forks source link

Support for disabled option in Select mode="tags" #30878

Open donysukardi opened 3 years ago

donysukardi commented 3 years ago

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Set disabled on Option for <Select mode="tags">. It's currently already working as expected,

Screenshot 2021-06-06 at 14 20 46

Except for the following issues,

Screenshot 2021-06-06 at 14 20 34

image

What is expected?

Select mode="tags" should support disabled option as it was working in antd@3. Warning shouldn't be shown.

What is actually happening?

disabled doesn't get propagated to the autocomplete option when using filterOption

Environment Info
antd 4.16.1
React 16.9.0
System macOS 11.3.1
Browser Google Chrome 91
afc163 commented 3 years ago

https://github.com/ant-design/ant-design/issues/14089

zombieJ commented 3 years ago

Hmmm... seems filterOption should also block selection by typing. I guess return empty list which pass the tags block.

donysukardi commented 3 years ago

It was working on antd@3 https://codesandbox.io/s/antd-tags-disabled-warning-antd3-wp0nw. When you type disabled option, it doesn't actually select it.