From 44ad6b0c07815af694c76b327f44f37191a2a9d9 Mon Sep 17 00:00:00 2001 From: wangxing Date: Thu, 28 Mar 2019 17:04:26 +0800 Subject: [PATCH] fix-15699 --- components/menu/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/menu/index.tsx b/components/menu/index.tsx index ab4500ce14..41cfbdd2b3 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -171,10 +171,12 @@ class Menu extends React.Component { // when inlineCollapsed menu width animation finished // https://github.com/ant-design/ant-design/issues/12864 const widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; + // Fix e.target.className.indexOf is not a function + // https://github.com/ant-design/ant-design/issues/15699 + const { className = '' } = e.target as HTMLElement; // Fix for , the width transition won't trigger when menu is collapsed // https://github.com/ant-design/ant-design-pro/issues/2783 - const iconScaled = - e.propertyName === 'font-size' && (e.target as HTMLElement).className.indexOf('anticon') >= 0; + const iconScaled = e.propertyName === 'font-size' && className.indexOf('anticon') >= 0; if (widthCollapsed || iconScaled) { this.restoreModeVerticalFromInline(); }