Skip to content

Commit

Permalink
allow changing type/role of buttons
Browse files Browse the repository at this point in the history
also support changing `tabIndex`.
closes #242.
  • Loading branch information
giladgray committed Dec 5, 2016
1 parent f891707 commit 73ef381
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/components/button/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export class Button extends React.Component<React.HTMLProps<HTMLButtonElement> &
const { children, disabled, elementRef, onClick, rightIconName, text } = this.props;
return (
<button
type="button"
{...removeNonHTMLProps(this.props)}
className={getButtonClasses(this.props)}
onClick={disabled ? undefined : onClick}
type="button"
ref={elementRef}
>
{text}
Expand All @@ -49,16 +49,16 @@ export class AnchorButton extends React.Component<React.HTMLProps<HTMLAnchorElem
public static displayName = "Blueprint.AnchorButton";

public render() {
const { children, disabled, href, onClick, rightIconName, text } = this.props;
const { children, disabled, href, onClick, rightIconName, tabIndex = 0, text } = this.props;
return (
<a
role="button"
{...removeNonHTMLProps(this.props)}
className={getButtonClasses(this.props)}
href={disabled ? undefined : href}
onClick={disabled ? undefined : onClick}
ref={this.props.elementRef}
role="button"
tabIndex={disabled ? undefined : 0}
tabIndex={disabled ? undefined : tabIndex}
>
{text}
{children}
Expand Down

0 comments on commit 73ef381

Please sign in to comment.