Clear error on modal toggle.

This commit is contained in:
orangemug 2017-04-02 16:02:57 +01:00
parent 396022e8ea
commit 2400c8ed00

View file

@ -98,6 +98,11 @@ class OpenModal extends React.Component {
reader.onerror = e => console.log(e.target); reader.onerror = e => console.log(e.target);
} }
onOpenToggle() {
this.clearError();
this.props.onOpenToggle();
}
render() { render() {
const styleOptions = publicStyles.map(style => { const styleOptions = publicStyles.map(style => {
return <PublicStyle return <PublicStyle
@ -121,7 +126,7 @@ class OpenModal extends React.Component {
return <Modal return <Modal
isOpen={this.props.isOpen} isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle} onOpenToggle={() => this.onOpenToggle()}
title={'Open Style'} title={'Open Style'}
> >
{errorElement} {errorElement}