Skip to content

Commit

Permalink
Adds preventDefault to Add property onClick
Browse files Browse the repository at this point in the history
  • Loading branch information
jermnelson committed Aug 7, 2020
1 parent be57c3a commit 97404c8
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -24,12 +24,17 @@ const NestedResourceActionButtons = (props) => {

const trashIcon = faTrashAlt

const addAnother = (event) => {
event.preventDefault()
return props.addSiblingValueSubject(_.last(siblingValues).key, resourceEditErrorKey(props.resourceKey))
}

return (<div className="btn-group pull-right" role="group">
{ showAddButton
&& <button
className="btn btn-sm btn-add-property btn-add-another"
aria-label={`Add another ${props.value.valueSubject.subjectTemplate.label}`}
onClick={() => props.addSiblingValueSubject(_.last(siblingValues).key, resourceEditErrorKey(props.resourceKey))}>+ Add another</button>
onClick={addAnother}>+ Add another</button>
}
{ showRemoveButton
&& <button
Expand Down

0 comments on commit 97404c8

Please sign in to comment.