I have a modern page with custom spfx webparts. My spfx webparts contains office ui fabric react components such as PeoplePicker and TaxonomyPicker.
After user enters the data and clicks save or save and close button, I need to override the event handler for Save event to save the information into the page. My idea is that I should override that Save event handler method so that my webpart callback handler will be called and updates the Page ListItem metadata. I also found onDisplayModeChanged event in the webpart from here, I am not sure how to find if the event is Save and close or Discard Changes.
Can anyone please suggest which is the elegant way to do that?