diff --git a/components/input-number/style/index.ts b/components/input-number/style/index.ts index 069418f6a0..32b3c884e4 100644 --- a/components/input-number/style/index.ts +++ b/components/input-number/style/index.ts @@ -358,6 +358,7 @@ const genAffixWrapperStyles: GenerateStyle = (token: InputNumb }, '&::before': { + display: 'inline-block', width: 0, visibility: 'hidden', content: '"\\a0"', diff --git a/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap index 9ac113d9a2..6e59fb7707 100644 --- a/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -6356,76 +6356,85 @@ exports[`renders components/input/demo/group.tsx extend context correctly 1`] = value="input content" />
-
- +
+
- + + - - - + + - -
-
- +
+
+ +
diff --git a/components/input/__tests__/__snapshots__/demo.test.tsx.snap b/components/input/__tests__/__snapshots__/demo.test.tsx.snap index c7e57cf589..3c72a8e975 100644 --- a/components/input/__tests__/__snapshots__/demo.test.tsx.snap +++ b/components/input/__tests__/__snapshots__/demo.test.tsx.snap @@ -2312,76 +2312,85 @@ exports[`renders components/input/demo/group.tsx correctly 1`] = ` value="input content" />
-
- +
+
- + + - - - + + - -
-
- +
+
+ +
diff --git a/components/input/demo/group.tsx b/components/input/demo/group.tsx index 16dbaf7049..4252e71d58 100644 --- a/components/input/demo/group.tsx +++ b/components/input/demo/group.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { CopyOutlined } from '@ant-design/icons'; import { AutoComplete, @@ -12,6 +11,7 @@ import { Select, Tooltip, } from 'antd'; +import React from 'react'; const { Option } = Select; @@ -102,7 +102,7 @@ const App: React.FC = () => ( - +
diff --git a/components/input/style/index.ts b/components/input/style/index.ts index 85e4eec5a6..fac6677eb5 100644 --- a/components/input/style/index.ts +++ b/components/input/style/index.ts @@ -412,11 +412,11 @@ export const genInputGroupStyle = (token: InputToken): CSSObject => { borderRadius: 0, }, - [`& > ${componentCls}-affix-wrapper`]: { - display: 'inline-flex', - }, - - [`& > ${antCls}-picker-range`]: { + [` + & > ${componentCls}-affix-wrapper, + & > ${componentCls}-number-affix-wrapper, + & > ${antCls}-picker-range + `]: { display: 'inline-flex', }, @@ -620,6 +620,7 @@ const genAffixStyle: GenerateStyle = (token: InputToken) => { }, '&::before': { + display: 'inline-block', width: 0, visibility: 'hidden', content: '"\\a0"',