From 27880b0110cba6a8f671b9ed49a048c556e3dbd6 Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Thu, 3 Jan 2019 13:06:27 +0800
Subject: [PATCH] feat: optimize the display of the button icon
---
.../button/__tests__/__snapshots__/demo.test.js.snap | 11 +++--------
.../button/__tests__/__snapshots__/index.test.js.snap | 2 +-
components/button/button.jsx | 3 ++-
components/button/style/index.less | 8 ++++++++
.../drawer/__tests__/__snapshots__/demo.test.js.snap | 3 +--
.../__tests__/__snapshots__/demo.test.js.snap | 3 +--
.../form/__tests__/__snapshots__/demo.test.js.snap | 3 +--
package.json | 2 +-
8 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/components/button/__tests__/__snapshots__/demo.test.js.snap b/components/button/__tests__/__snapshots__/demo.test.js.snap
index b78691ad6..c7ba670e2 100644
--- a/components/button/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/button/__tests__/__snapshots__/demo.test.js.snap
@@ -13,9 +13,7 @@ exports[`renders ./components/button/demo/button-group.md correctly 1`] = `
`;
exports[`Button renders Chinese characters correctly 3`] = `
diff --git a/components/button/button.jsx b/components/button/button.jsx
index 7284573df..73e1a926c 100644
--- a/components/button/button.jsx
+++ b/components/button/button.jsx
@@ -120,7 +120,8 @@ export default {
}
const iconType = sLoading ? 'loading' : icon
const iconNode = iconType ?
: null
- const kids = $slots.default && $slots.default.length === 1 ? this.insertSpace($slots.default[0], this.isNeedInserted()) : $slots.default
+ const children = filterEmpty($slots.default)
+ const kids = children.map(child => this.insertSpace(child, this.isNeedInserted()))
if ($attrs.href !== undefined) {
return (
diff --git a/components/button/style/index.less b/components/button/style/index.less
index 9e6a01cf1..6f782647e 100644
--- a/components/button/style/index.less
+++ b/components/button/style/index.less
@@ -92,6 +92,14 @@
.@{iconfont-css-prefix} {
transition: margin-left 0.3s @ease-in-out;
+ // Follow icon blur under windows. Change the render.
+ // https://github.com/ant-design/ant-design/issues/13924
+ &.@{iconfont-css-prefix}-plus,
+ &.@{iconfont-css-prefix}-minus {
+ > svg {
+ shape-rendering: optimizeSpeed;
+ }
+ }
}
&&-loading:before {
diff --git a/components/drawer/__tests__/__snapshots__/demo.test.js.snap b/components/drawer/__tests__/__snapshots__/demo.test.js.snap
index 5bc95082a..d470284fd 100644
--- a/components/drawer/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/drawer/__tests__/__snapshots__/demo.test.js.snap
@@ -9,8 +9,7 @@ exports[`renders ./components/drawer/demo/basic-right.md correctly 1`] = `
exports[`renders ./components/drawer/demo/form-in-drawer.md correctly 1`] = `
+
New account
`;
diff --git a/components/dropdown/__tests__/__snapshots__/demo.test.js.snap b/components/dropdown/__tests__/__snapshots__/demo.test.js.snap
index 0e4efc93f..46d62eb56 100644
--- a/components/dropdown/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/dropdown/__tests__/__snapshots__/demo.test.js.snap
@@ -16,8 +16,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `