Skip to content

Commit

Permalink
feat(AutoComplete): AutoComplete support rootClassName (ant-design#44055
Browse files Browse the repository at this point in the history
)

* feat: AutoComplete support rootClassName

* feat: AutoComplete support rootClassName

* feat: update snap

* feat: optimize code

* feat: optimize code

* Update components/auto-complete/demo/basic.tsx

Signed-off-by: kiner-tang(文辉) <1127031143@qq.com>

* feat: update snap

* Update components/auto-complete/index.en-US.md

Signed-off-by: kiner-tang(文辉) <1127031143@qq.com>

* Update components/auto-complete/index.zh-CN.md

Signed-off-by: kiner-tang(文辉) <1127031143@qq.com>

* feat: optimize code

* feat: optimize code

---------

Signed-off-by: kiner-tang(文辉) <1127031143@qq.com>
  • Loading branch information
kiner-tang authored Aug 8, 2023
1 parent bd54d4e commit 9d122a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 0 additions & 3 deletions components/auto-complete/__tests__/demo.test.ts

This file was deleted.

15 changes: 15 additions & 0 deletions components/auto-complete/__tests__/demo.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as React from 'react';
import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest';

demoTest('auto-complete', {
testRootProps: false,
});

rootPropsTest(
'auto-complete',
(AutoComplete, props) => <AutoComplete {...props} options={[{ value: 'ddd' }]} />,
{
findRootElements: () => document.querySelectorAll('.ant-select, .ant-select-dropdown'),
expectCount: 2,
},
);
2 changes: 1 addition & 1 deletion components/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface InternalSelectProps<
ValueType = any,
OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType,
> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {
rootClassName?: string;
suffixIcon?: React.ReactNode;
size?: SizeType;
disabled?: boolean;
Expand All @@ -67,7 +68,6 @@ export interface SelectProps<
popupClassName?: string;
/** @deprecated Please use `popupClassName` instead */
dropdownClassName?: string;
rootClassName?: string;
/** @deprecated Please use `popupMatchSelectWidth` instead */
dropdownMatchSelectWidth?: boolean | number;
popupMatchSelectWidth?: boolean | number;
Expand Down

0 comments on commit 9d122a6

Please sign in to comment.