-
`;
-exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
`;
+exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
`;
-exports[`renders ./components/input/demo/size.md correctly 1`] = `
`;
+exports[`renders ./components/input/demo/size.md correctly 1`] = `
`;
exports[`renders ./components/input/demo/textarea.md correctly 1`] = `
`;
exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `
`;
-exports[`renders ./components/input/demo/tooltip.md correctly 1`] = `
`;
+exports[`renders ./components/input/demo/tooltip.md correctly 1`] = `
`;
diff --git a/components/input/__tests__/__snapshots__/index.test.js.snap b/components/input/__tests__/__snapshots__/index.test.js.snap
index df5b1c5b2..2ccc58e32 100644
--- a/components/input/__tests__/__snapshots__/index.test.js.snap
+++ b/components/input/__tests__/__snapshots__/index.test.js.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Input should support maxLength 1`] = `
`;
+exports[`Input should support maxLength 1`] = `
`;
exports[`Input.Search should support suffix 1`] = `
suffix`;
diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js
index 00837b58a..72d511079 100644
--- a/components/input/__tests__/index.test.js
+++ b/components/input/__tests__/index.test.js
@@ -19,6 +19,14 @@ describe('Input', () => {
const wrapper = mount(Input);
wrapper.vm.select();
});
+
+ it('should not support allowClear when it is disabled', () => {
+ const wrapper = mount(Input, {
+ propsData: { allowClear: true, defaultValue: '111', disabled: true },
+ sync: false,
+ });
+ expect(wrapper.findAll('.ant-input-clear-icon').length).toBe(0);
+ });
});
focusTest(TextArea);
diff --git a/components/input/style/index.less b/components/input/style/index.less
index 390a7e39f..53fd3f0e9 100644
--- a/components/input/style/index.less
+++ b/components/input/style/index.less
@@ -39,4 +39,27 @@
}
}
+// fix style #1296, remove annotation when upgrade ant-design version > 3.21.3
+.@{ant-prefix}-input-clear-icon {
+ color: @disabled-color;
+ font-size: @font-size-sm;
+ // https://github.com/ant-design/ant-design/pull/18151
+ // https://codesandbox.io/s/wizardly-sun-u10br
+ vertical-align: 0;
+ cursor: pointer;
+ transition: color 0.3s;
+
+ &:hover {
+ color: @text-color-secondary;
+ }
+
+ &:active {
+ color: @text-color;
+ }
+
+ + i {
+ margin-left: 6px;
+ }
+}
+
@import './search-input';
diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less
index b7d1aba8f..08c6f99bb 100644
--- a/components/input/style/mixin.less
+++ b/components/input/style/mixin.less
@@ -363,6 +363,8 @@
position: absolute;
top: 50%;
z-index: 2;
+ display: flex;
+ align-items: center;
color: @input-color;
line-height: 0;
transform: translateY(-50%);
diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap
index 2ded8f0c8..b1c6e68da 100644
--- a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap
@@ -50,7 +50,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
@@ -69,7 +69,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
index 720e9dea4..cf952babe 100644
--- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
+++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
@@ -574,7 +574,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
@@ -593,7 +593,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
@@ -988,7 +988,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
@@ -1007,7 +1007,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
@@ -1402,7 +1402,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
@@ -1421,7 +1421,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
@@ -1816,7 +1816,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
@@ -1835,7 +1835,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
@@ -2230,7 +2230,7 @@ exports[`Locale Provider should display the text as da 1`] = `
@@ -2249,7 +2249,7 @@ exports[`Locale Provider should display the text as da 1`] = `
@@ -2644,7 +2644,7 @@ exports[`Locale Provider should display the text as de 1`] = `
@@ -2663,7 +2663,7 @@ exports[`Locale Provider should display the text as de 1`] = `
@@ -3058,7 +3058,7 @@ exports[`Locale Provider should display the text as el 1`] = `
@@ -3077,7 +3077,7 @@ exports[`Locale Provider should display the text as el 1`] = `
@@ -3472,7 +3472,7 @@ exports[`Locale Provider should display the text as en 1`] = `
@@ -3491,7 +3491,7 @@ exports[`Locale Provider should display the text as en 1`] = `
@@ -3886,7 +3886,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
@@ -3905,7 +3905,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
@@ -4300,7 +4300,7 @@ exports[`Locale Provider should display the text as es 1`] = `
@@ -4319,7 +4319,7 @@ exports[`Locale Provider should display the text as es 1`] = `
@@ -4714,7 +4714,7 @@ exports[`Locale Provider should display the text as et 1`] = `
@@ -4733,7 +4733,7 @@ exports[`Locale Provider should display the text as et 1`] = `
@@ -5128,7 +5128,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
@@ -5147,7 +5147,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
@@ -5542,7 +5542,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
@@ -5561,7 +5561,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
@@ -5956,7 +5956,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
@@ -5975,7 +5975,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
@@ -6370,7 +6370,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
@@ -6389,7 +6389,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
@@ -6784,7 +6784,7 @@ exports[`Locale Provider should display the text as he 1`] = `
@@ -6803,7 +6803,7 @@ exports[`Locale Provider should display the text as he 1`] = `
@@ -7198,7 +7198,7 @@ exports[`Locale Provider should display the text as hi 1`] = `
@@ -7217,7 +7217,7 @@ exports[`Locale Provider should display the text as hi 1`] = `
@@ -7607,7 +7607,7 @@ exports[`Locale Provider should display the text as hu 1`] = `
@@ -7626,7 +7626,7 @@ exports[`Locale Provider should display the text as hu 1`] = `
@@ -8021,7 +8021,7 @@ exports[`Locale Provider should display the text as id 1`] = `
@@ -8040,7 +8040,7 @@ exports[`Locale Provider should display the text as id 1`] = `
@@ -8435,7 +8435,7 @@ exports[`Locale Provider should display the text as is 1`] = `
@@ -8454,7 +8454,7 @@ exports[`Locale Provider should display the text as is 1`] = `
@@ -8849,7 +8849,7 @@ exports[`Locale Provider should display the text as it 1`] = `
@@ -8868,7 +8868,7 @@ exports[`Locale Provider should display the text as it 1`] = `
@@ -9263,7 +9263,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
@@ -9282,7 +9282,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
@@ -9677,7 +9677,7 @@ exports[`Locale Provider should display the text as kn 1`] = `