select
select copied to clipboard
React Select
onBlur 的默认行为太多了, 自定义 dorpdown 基本无法使用 比如: 1. toggleOpen(false) , 导致无法使用内嵌 modal 2. clearSearchValue(''), 导致无法在自定义 DorndpwnRender内部修改去切换 mode, 因为tag 模式下, blur 会视为添加到 options, 导致切换到其他的 mode 会额外多出这个 option,切换一次多一次 @afc163 一个函数应该只做一件事情, 不要加太多自己的默认行为进去却不提供撤销方式
fix https://github.com/ant-design/ant-design/issues/42924 resolve https://github.com/ant-design/ant-design/discussions/42863 https://stackblitz.com/edit/react-djm2de?file=index.tsx 把onBlur事件 从 inputContainer 移动到popover上 解决的问题: 原先, 当点击按钮,弹窗打开时,popover就会意外关闭, 修复后: 当点击按钮,弹窗打开时,popover不会意外关闭 但是想要彻底解决问题, 还需要最后一步, modal组件的dialog容器onClick时 阻止事件冒泡, 这样应该不会触发popover上的onBlur
https://stackblitz.com/edit/react-djm2de?file=demo.tsx https://stackblitz.com/edit/react-13vdsn?file=demo.tsx Steps to reproduce 输入 1, 然后点击 下拉面板中的 号 What is expected? 点击 号, 不要清空搜索值 What is actually happening? 点击 号, 搜索值被清空了 antd issue: https://github.com/ant-design/ant-design/issues/42933
Opening [this demo](https://select-react-component.vercel.app/demo/single) example on an iOS device, Safari, and clicking the X (clear) icon doesn't clear the select box. This issue was also reported here: https://github.com/ant-design/ant-design/issues/28917 A Stackblitz repro...
之前在antd Issue其实是有提到这个问题,在自定义设计checkbox多选框的样式后,我觉得是非常麻烦的,我除了要自己控制value之外,还得控制onSearch,onClear,onDeselect等等保证Select的正常运行,但我却仅仅是想改变一个Option的样式仅此而已。 目前在我看来更应该在这里提,我理解rc-select是一个无样式组件,那么在Option自定义环节是否可以参考类似[headlessui的设计](https://headlessui.com/react/radio-group): ``` {({ checked }) => ( Startup )} ``` 当然我的例子可能和select无关,我只是想表达我们在设计select option时候能否给使用者更大的样式控制权,组建本身也只是抛出状态,并不会破坏组件本身的逻辑。
How do I add custom styles to the input on inside the `Select`
After migrating to the new @rc-component/trigger, there were problems with the calculation of nextOffsetX, which causes an incorrect popup offset. https://github.com/react-component/trigger/issues/333#issue-1606140740
### Existing Code ```ts export interface SelectProps extends BaseSelectPropsWithoutPrivate { //... optionFilterProp?: string; } ``` ### Proposed Code ```ts export interface SelectProps extends BaseSelectPropsWithoutPrivate { //... optionFilterProp?: keyof OptionType; }...