Merge pull request #719 from desktop/you-look-like-a-ref-face

Button reference fix
This commit is contained in:
Markus Olsson 2016-12-06 15:47:58 +01:00 committed by GitHub
commit 885c401481
2 changed files with 3 additions and 3 deletions

View file

@ -24,7 +24,7 @@ interface IButtonProps {
* handling of the `ref` type into some ungodly monstrosity. Hopefully someday
* this will be unnecessary.
*/
readonly reference?: React.Ref<HTMLButtonElement>
readonly onButtonRef?: (instance: HTMLButtonElement) => void
}
/** A button component. */
@ -38,7 +38,7 @@ export class Button extends React.Component<IButtonProps, void> {
disabled={this.props.disabled}
onClick={this.onClick}
type={this.props.type}
ref={this.props.reference}>
ref={this.props.onButtonRef}>
{this.props.children}
</button>
)

View file

@ -78,7 +78,7 @@ export class ToolbarButton extends React.Component<IToolbarButtonProps, void> {
return (
<div className={className}>
{preContent}
<Button onClick={this.onClick} reference={this.onButtonRef}>
<Button onClick={this.onClick} onButtonRef={this.onButtonRef}>
{icon}
{this.renderText()}
{this.props.children}