Skip to content

Commit

Permalink
fix(widget-relation): don't invoke onChange if component is not mount…
Browse files Browse the repository at this point in the history
…ed (#5804)
  • Loading branch information
erezrokah committed Sep 13, 2021
1 parent b2a4a44 commit bd35474
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/netlify-cms-widget-relation/src/RelationControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ export default class RelationControl extends React.Component {
this.mounted && this.setState({ initialOptions });

//set metadata
onChange(value, {
[field.get('name')]: {
[field.get('collection')]: metadata,
},
});
this.mounted &&
onChange(value, {
[field.get('name')]: {
[field.get('collection')]: metadata,
},
});
}
}

Expand Down

0 comments on commit bd35474

Please sign in to comment.