@@ -4,7 +4,6 @@ import KeyCode from 'rc-util/lib/KeyCode';
44import isMobile from 'rc-util/lib/isMobile' ;
55import { useComposeRef } from 'rc-util/lib/ref' ;
66import type { ScrollTo } from 'rc-virtual-list/lib/List' ;
7- import pickAttrs from 'rc-util/lib/pickAttrs' ;
87import useMergedState from 'rc-util/lib/hooks/useMergedState' ;
98import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect' ;
109import { getSeparatedContent } from './utils/valueUtil' ;
@@ -21,12 +20,17 @@ import { BaseSelectContext } from './hooks/useBaseProps';
2120const DEFAULT_OMIT_PROPS = [
2221 'value' ,
2322 'onChange' ,
24- 'onSelect ' ,
23+ 'removeIcon ' ,
2524 'placeholder' ,
2625 'autoFocus' ,
26+ 'maxTagCount' ,
27+ 'maxTagTextLength' ,
28+ 'maxTagPlaceholder' ,
29+ 'choiceTransitionName' ,
2730 'onInputKeyDown' ,
31+ 'onPopupScroll' ,
2832 'tabIndex' ,
29- ] ;
33+ ] as const ;
3034
3135export type RenderNode = React . ReactNode | ( ( props : any ) => React . ReactNode ) ;
3236
@@ -69,6 +73,7 @@ export interface BaseSelectPrivateProps {
6973 // >>> MISC
7074 id : string ;
7175 prefixCls : string ;
76+ omitProps ?: string [ ] ;
7277
7378 // >>> Value
7479 displayValues : DisplayValueType [ ] ;
@@ -197,6 +202,7 @@ const BaseSelect = React.forwardRef((props: BaseSelectProps, ref: React.Ref<Base
197202 showSearch,
198203 tagRender,
199204 direction,
205+ omitProps,
200206
201207 // Value
202208 displayValues,
@@ -269,13 +275,16 @@ const BaseSelect = React.forwardRef((props: BaseSelectProps, ref: React.Ref<Base
269275 const mergedShowSearch =
270276 ( showSearch !== undefined ? showSearch : multiple ) || mode === 'combobox' ;
271277
272- const domProps = pickAttrs ( restProps , {
273- aria : true ,
274- attr : true ,
275- data : true ,
278+ const domProps = {
279+ ...restProps ,
280+ } as Omit < keyof typeof restProps , typeof DEFAULT_OMIT_PROPS [ number ] > ;
281+
282+ DEFAULT_OMIT_PROPS . forEach ( ( propName ) => {
283+ delete domProps [ propName ] ;
276284 } ) ;
277- DEFAULT_OMIT_PROPS . forEach ( ( prop ) => {
278- delete domProps [ prop ] ;
285+
286+ omitProps ?. forEach ( ( propName ) => {
287+ delete domProps [ propName ] ;
279288 } ) ;
280289
281290 // ============================= Mobile =============================
0 commit comments