Skip to content

Commit

Permalink
add activeClassName for button
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud committed Jun 21, 2017
1 parent 986ce1d commit 3331f00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions components/button/PropsType.tsx
Expand Up @@ -15,6 +15,7 @@ export interface ButtonWebProps extends WebProps, ButtonProps {
inline?: boolean;
across?: boolean;
icon?: string;
activeClassName?: string;
}

export interface ButtonNativeProps extends NativeProps, ButtonProps {
Expand Down
6 changes: 3 additions & 3 deletions components/button/index.web.tsx
Expand Up @@ -39,8 +39,8 @@ class Button extends React.Component<ButtonWebProps, any> {
render() {
const {
children, className, prefixCls, type, size, inline, across,
disabled, icon, loading, activeStyle, onClick, delayPressIn,
delayPressOut, ...restProps,
disabled, icon, loading, activeStyle, activeClassName, onClick,
delayPressIn, delayPressOut, ...restProps,
} = this.props;

const wrapCls = {
Expand Down Expand Up @@ -73,7 +73,7 @@ class Button extends React.Component<ButtonWebProps, any> {
// use div, button native is buggy @yiminghe
return (
<Touchable
activeClassName={activeStyle ? `${prefixCls}-active` : undefined}
activeClassName={activeClassName || (activeStyle ? `${prefixCls}-active` : undefined)}
disabled={disabled}
activeStyle={activeStyle}
{...delayProps}
Expand Down

1 comment on commit 3331f00

@paranoidjk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@silentcloud 以后记得同步更新api文档,我帮你加上了

Please sign in to comment.