I have created a modal with some dynamic content (input fields) and a save button to save input field data in database and I'm opening that modal on a button click.
Now when I fill all the input fields and save it or when I close the modal by pressing the "X" icon at top right without saving, the data in the modal persists and doesn't get cleared when I reopen that modal using button click.
Is there a way to completely destroy that modal and create a fresh one on each button click?