From ac1dc8bb5f14411ec3e38697b85063fb44697088 Mon Sep 17 00:00:00 2001 From: jljsj33 Date: Wed, 18 Jul 2018 19:49:31 +0800 Subject: [PATCH] fix vw, be https://github.com/ant-design/ant-design/issues/11326 --- assets/index.less | 2 +- examples/simple.js | 4 ++-- src/Drawer.js | 52 +++++++++++++++++++++++++++++++--------------- src/utils.js | 6 +++++- 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/assets/index.less b/assets/index.less index c559b155..c69c9d4d 100755 --- a/assets/index.less +++ b/assets/index.less @@ -21,9 +21,9 @@ } &-content-wrapper { position: absolute; + background: #fff; } &-content { - background: #fff; overflow: auto; z-index: 1; position: relative; diff --git a/examples/simple.js b/examples/simple.js index fb1401f9..21bdbed2 100755 --- a/examples/simple.js +++ b/examples/simple.js @@ -15,9 +15,9 @@ const MenuItemGroup = Menu.ItemGroup; ReactDom.render((
- +
{ - this.contextDom = c; + this.contentDom = c; }} onTouchStart={open ? this.removeStartHandler : null} // 跑用例用 onTouchMove={open ? this.removeMoveHandler : null} // 跑用例用 @@ -428,7 +444,7 @@ class Drawer extends React.PureComponent { if ( currentTarget === this.maskDom || currentTarget === this.handlerdom || - (currentTarget === this.contextDom && + (currentTarget === this.contentDom && ((((currentTarget.scrollTop + currentTarget.offsetHeight >= currentTarget.scrollHeight && differY < 0) || (currentTarget.scrollTop <= 0 && differY > 0)) && @@ -507,6 +523,8 @@ Drawer.propTypes = { className: PropTypes.string, children: PropTypes.node, style: PropTypes.object, + width: PropTypes.any, + height: PropTypes.any, defaultOpen: PropTypes.bool, firstEnter: PropTypes.bool, open: PropTypes.bool, diff --git a/src/utils.js b/src/utils.js index ac1b0d79..c47aab8d 100755 --- a/src/utils.js +++ b/src/utils.js @@ -49,4 +49,8 @@ export function transformArguments(arg, cb) { return [result[0], result[1]]; } return [result]; -} \ No newline at end of file +} + +export const isNumeric = (value) => { + return !isNaN(parseFloat(value)) && isFinite(value);// eslint-disable-line +}; \ No newline at end of file