-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Antd] Select can not work with mode='tags' #2
Comments
@xrutayisire I found the problem is in what actually useEffect(() => {
Array.from(
document.getElementsByClassName('ant-select-selection-search-input')
).forEach((element: Element) => {
element.setAttribute('readonly', 'readonly')
})
}, []) |
Hey, Thanks for the report! I see the problem, I will provide a fix 👍 useEffect(() => {
Array.from(
document.getElementsByClassName('ant-select-selection-search-input')
).forEach((element: Element) => {
element.setAttribute('readonly', 'readonly')
})
}, []) This code is used to disabled hidden search input of antd that cause problems because we don't want any search field on it. |
Any problems if change mode to <Select
mode='multiple'
allowClear={!readOnly}
.... /> |
I heavily use the prop "tagRender" from antd so that's why I used "tags" mode. I just checked antd documentation and then RcSelect documentation about "tagRender" and they added unit tests and examples only with "tags" mode. BUT the doc don't talk about the "mode" (yet)
BUT again, it's currently working with "multiple" as you point out... Let me check If I find out mode about the use of "tagRender" with "multiple" 🙂
|
Ok, it seems to be ok to use it with "multiple". 🥳 Anyway to give you info about it:
And as you can see here (ant-design/ant-design#21064 (comment)) they even discussed it with "multiple" mode and updated the demo: https://github.com/ant-design/ant-design/blob/master/components/select/demo/custom-tag-render.md#en-us So good for me, let me change that, check if everything work fine and I will release a new hotfix of "react-js-cron". |
It's live 🥳 New version 1.1.1: https://www.npmjs.com/package/react-js-cron Try it and let me know but you should not have any problem now 🙂 I forked your example to show you the fix: https://stackblitz.com/edit/react-mdwfya-t1i1wg?file=package.json |
Select can not work with mode='tags', become mode='multiple' when using with react-js-cron
playground: https://stackblitz.com/edit/react-mdwfya?file=index.js
The text was updated successfully, but these errors were encountered: