Closed josephjeno closed 5 years ago
I've pushed a new release that should fix the following conditions:
Cancel
on a save dialog with empty field produces no closureCancel
will check for existence instead of closureRun npm update @osjs/dialogs
and npm run build
to update.
Let me know if this takes care of this issue and close it :)
In hindsight this was kind of a silly mistake. The Cancel
button was never actually accounted for in the callback function, so this should fix any side-effects relating to pushing that button.
I really need to get started on adding tests here as I've done in all other libraries related to this project :blush:
Just doing a ping since it's been almost a week since you opened this issue :innocent:
Ah my bad, yes it's been working perfecto! Thanks Anders!
I am using the below code for creating and acting on a Save Dialog in OSjs.
And the resulting Dialog:
At this point, I would expect clicking the Cancel button to trigger a callback with status = 'cancel' and file = null. However the Cancel button callback doesn't trigger until Filename is populated with some text.
There also appears to be an error handler that triggers if the text equals an existing filename, even if the Cancel button was pressed and not the OK button, example below:
Pressing No returns to the Save Dialog, and pressing Yes on the Confirm window closes the Save Dialog and sends the status = 'cancel' callback.
I believe expected behavior is to not display the Confirm dialog when Cancel is pressed and to simply close the Save Dialog while sending the 'cancel' callback, regardless of whether any text is input in the Filename field.
Thanks Anders, you're the man.