Fixed event handlers not properly called

This commit is contained in:
Alejandro Celaya 2018-08-26 19:30:56 +02:00
parent 2fdc7a0ff0
commit 933de6e2c5
3 changed files with 4 additions and 3 deletions

View file

@ -22,6 +22,7 @@
"rules": { "rules": {
"comma-dangle": ["error", "always-multiline"], "comma-dangle": ["error", "always-multiline"],
"no-invalid-this": "off", "no-invalid-this": "off",
"no-console": "warn",
"template-curly-spacing": ["error", "never"], "template-curly-spacing": ["error", "never"],
"no-warning-comments": "off", "no-warning-comments": "off",
"no-undefined": "off", "no-undefined": "off",

View file

@ -62,7 +62,7 @@ export class EditTagsModalComponent extends React.Component {
const { isOpen, toggle, url, shortUrlTags } = this.props; const { isOpen, toggle, url, shortUrlTags } = this.props;
return ( return (
<Modal isOpen={isOpen} toggle={toggle} centered onClosed={() => this.refreshShortUrls}> <Modal isOpen={isOpen} toggle={toggle} centered onClosed={() => this.refreshShortUrls()}>
<ModalHeader toggle={toggle}> <ModalHeader toggle={toggle}>
Edit tags for <ExternalLink href={url}>{url}</ExternalLink> Edit tags for <ExternalLink href={url}>{url}</ExternalLink>
</ModalHeader> </ModalHeader>
@ -80,7 +80,7 @@ export class EditTagsModalComponent extends React.Component {
className="btn btn-primary" className="btn btn-primary"
type="button" type="button"
disabled={shortUrlTags.saving} disabled={shortUrlTags.saving}
onClick={() => this.saveTags} onClick={() => this.saveTags()}
> >
{shortUrlTags.saving ? 'Saving tags...' : 'Save tags'} {shortUrlTags.saving ? 'Saving tags...' : 'Save tags'}
</button> </button>

View file

@ -74,7 +74,7 @@ export class EditTagModalComponent extends React.Component {
return ( return (
<Modal isOpen={isOpen} toggle={toggle} centered onClosed={this.handleOnClosed}> <Modal isOpen={isOpen} toggle={toggle} centered onClosed={this.handleOnClosed}>
<form onSubmit={() => this.saveTag()}> <form onSubmit={(e) => this.saveTag(e)}>
<ModalHeader toggle={toggle}>Edit tag</ModalHeader> <ModalHeader toggle={toggle}>Edit tag</ModalHeader>
<ModalBody> <ModalBody>
<div className="input-group"> <div className="input-group">