diff --git a/components/select/__tests__/index.test.tsx b/components/select/__tests__/index.test.tsx
index 940c0a022e..f7b33f99e8 100644
--- a/components/select/__tests__/index.test.tsx
+++ b/components/select/__tests__/index.test.tsx
@@ -3,6 +3,7 @@ import { CloseOutlined } from '@ant-design/icons';
import type { SelectProps } from '..';
import Select from '..';
+import Form from '../../form';
import { resetWarned } from '../../_util/warning';
import focusTest from '../../../tests/shared/focusTest';
import mountTest from '../../../tests/shared/mountTest';
@@ -126,6 +127,43 @@ describe('Select', () => {
});
});
+ describe('clear icon position', () => {
+ it('normal', () => {
+ const { container } = render(
+ ,
+ );
+ expect(
+ getComputedStyle(container.querySelector('.ant-select-clear')!).insetInlineEnd,
+ ).toEqual('11px');
+ });
+
+ it('hasFeedback, has validateStatus', () => {
+ const { container } = render(
+
+ ,
+
+ ,
+ );
+ expect(
+ getComputedStyle(container.querySelector('.ant-select-clear')!).insetInlineEnd,
+ ).toEqual('33px');
+ });
+
+ it('hasFeedback, no validateStatus', () => {
+ const { container } = render(
+
+ ,
+
+ ,
+ );
+ expect(
+ getComputedStyle(container.querySelector('.ant-select-clear')!).insetInlineEnd,
+ ).toEqual('11px');
+ });
+ });
+
describe('Deprecated', () => {
it('should ignore mode="combobox"', () => {
const { asFragment } = render(
diff --git a/components/select/style/index.ts b/components/select/style/index.ts
index b8ee95a76a..74bb1e3266 100644
--- a/components/select/style/index.ts
+++ b/components/select/style/index.ts
@@ -186,7 +186,7 @@ const genBaseStyle: GenerateStyle = (token) => {
// ========================= Feedback ==========================
[`${componentCls}-status`]: {
- [`&-error, &-warning, &-success, &-validating`]: {
+ '&-error, &-warning, &-success, &-validating': {
[`&${componentCls}-has-feedback`]: {
[`${componentCls}-clear`]: {
insetInlineEnd: token