diff --git a/ui/perfherder/alerts/NotesModal.jsx b/ui/perfherder/alerts/NotesModal.jsx
index e55a2b7af34..83470eb0484 100644
--- a/ui/perfherder/alerts/NotesModal.jsx
+++ b/ui/perfherder/alerts/NotesModal.jsx
@@ -6,7 +6,7 @@ export default class NotesModal extends React.Component {
constructor(props) {
super(props);
this.state = {
- inputValue: this.props.alertSummary.notes,
+ inputValue: this.props.alertSummary.notes || '',
};
}
@@ -14,8 +14,23 @@ export default class NotesModal extends React.Component {
this.setState({ inputValue: event.target.value });
};
+ handleSubmit = (event) => {
+ event.preventDefault();
+
+ const { updateAndClose } = this.props;
+ const { inputValue } = this.state;
+
+ updateAndClose(
+ event,
+ {
+ notes: inputValue.length ? inputValue : null,
+ },
+ 'showNotesModal',
+ );
+ };
+
render() {
- const { showModal, toggle, alertSummary, updateAndClose } = this.props;
+ const { showModal, toggle, alertSummary } = this.props;
const { inputValue } = this.state;
return (
@@ -23,12 +38,13 @@ export default class NotesModal extends React.Component {