From 59093a658648ade61586459ad6470d29b490f09b Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 14 Sep 2016 16:59:45 +0800 Subject: [PATCH] fix: should pass prefixCls correctly --- components/affix/index.tsx | 7 ++----- components/cascader/index.tsx | 10 +++++----- components/table/Table.tsx | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/components/affix/index.tsx b/components/affix/index.tsx index 39430f9aa3..d1db87e862 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -2,8 +2,8 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import addEventListener from 'rc-util/lib/Dom/addEventListener'; import classNames from 'classnames'; -import assign from 'object-assign'; import shallowequal from 'shallowequal'; +import omit from 'omit.js'; function getScroll(target, top) { const prop = top ? 'pageYOffset' : 'pageXOffset'; @@ -220,10 +220,7 @@ export default class Affix extends React.Component { [this.props.prefixCls]: this.state.affixStyle, }); - const props = assign({}, this.props); - delete props.offsetTop; - delete props.offsetBottom; - delete props.target; + const props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target']); return (
diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 7269d28071..582e8b545e 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -234,15 +234,15 @@ export default class Cascader extends React.Component { render() { const props = this.props; const state = this.state; - const [{ prefixCls, children, placeholder, size, disabled, + const [{ prefixCls, inputPrefixCls, children, placeholder, size, disabled, className, style, allowClear, showSearch }, otherProps] = splitObject(props, - ['prefixCls', 'children', 'placeholder', 'size', 'disabled', 'className', - 'style', 'allowClear', 'showSearch']); + ['prefixCls', 'inputPrefixCls', 'children', 'placeholder', 'size', 'disabled', + 'className', 'style', 'allowClear', 'showSearch']); const value = state.value; const sizeCls = classNames({ - [`${props.inputPrefixCls}-lg`]: size === 'large', - [`${props.inputPrefixCls}-sm`]: size === 'small', + [`${inputPrefixCls}-lg`]: size === 'large', + [`${inputPrefixCls}-sm`]: size === 'small', }); const clearIcon = (allowClear && !disabled && value.length > 0) || state.inputValue ? { let table = (