select icon indicating copy to clipboard operation
select copied to clipboard

select选择后报错`label` of `value` is not same as `label` in Select options.

Open s464446877 opened this issue 3 years ago • 2 comments

option里不是string而是dom结构的情景下,如果在onchange事件里去更新state,就会报这个错误,感觉原因是在抛出警告的判断上,optionlabel和rowlabel如果是reactnode的情况下,他们两个虽然结构一样但是不相等

s464446877 avatar Jul 21 '22 03:07 s464446877

I am facing this issue as well. It occurs when using React elements, i.e. not strings, as labels.

devkat avatar Jan 30 '23 14:01 devkat

https://github.com/react-component/select/blob/fe1a13a6ccb9551e17fe7c8ea282bf5df907041d/src/Select.tsx#L275

in here , if options render label using React elements will trigger this problem. maybe just ignore react element compare equal.

ref: https://github.com/ant-design/ant-design/issues/40205

ZWkang avatar Feb 20 '23 06:02 ZWkang