From 2e3937ecbf3a71ab76d8f9bb557b15674b3c5567 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 12 Jul 2021 13:25:41 +0800 Subject: [PATCH] style: fix Cascader style inside Input addon (#31350) close #31333 --- .../__tests__/__snapshots__/demo.test.js.snap | 84 ++++++++++++++++--- components/input/demo/addon.md | 26 +++--- components/input/style/mixin.less | 11 +++ 3 files changed, 96 insertions(+), 25 deletions(-) diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index e1f336cdc1..48c8abf63d 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -1,9 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./components/input/demo/addon.md correctly 1`] = ` -Array [ +
-
, +
-
, +
-
, +
-
, -] + +
+ + + + + + + + + + + + + + +
+ `; exports[`renders ./components/input/demo/align.md correctly 1`] = ` diff --git a/components/input/demo/addon.md b/components/input/demo/addon.md index a2d878e3bd..31426e1d64 100644 --- a/components/input/demo/addon.md +++ b/components/input/demo/addon.md @@ -14,7 +14,7 @@ title: Using pre & post tabs example. ```jsx -import { Input, Select } from 'antd'; +import { Input, Select, Space, Cascader } from 'antd'; import { SettingOutlined } from '@ant-design/icons'; const { Option } = Select; @@ -35,20 +35,16 @@ const selectAfter = ( ); ReactDOM.render( - <> -
- -
-
- -
-
- } defaultValue="mysite" /> -
-
- -
- , + + + + } defaultValue="mysite" /> + + } + defaultValue="mysite" + /> + , mountNode, ); ``` diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less index 73d7c1452e..f07f15bfbf 100644 --- a/components/input/style/mixin.less +++ b/components/input/style/mixin.less @@ -205,6 +205,17 @@ } } } + + // https://github.com/ant-design/ant-design/issues/31333 + .@{ant-prefix}-cascader-picker { + margin: -9px (-@control-padding-horizontal); + background-color: transparent; + .@{ant-prefix}-cascader-input { + text-align: left; + border: 0; + box-shadow: none; + } + } } // Reset rounded corners