Open keithamus opened 10 months ago
For me it would make sense for cancel buttons to cancel the dialog. If the dialog is designed to make a decision or enter data and you don't then it's a "cancel" to me and the button should be able to signify this.
So I reckon we should keep it.
As a consumer of the dialog element I don't really care about close watchers Vs light dismiss (if that gets added) Vs my own cancel button. I just want an easy signal for "this didn't do the thing I was hoping it would"
The Open UI Community Group just discussed [invokers] Should invokers on dialog have a cancel action?
, and agreed to the following:
RESOLVED: Invokers will only provide a close action, and the cancel operation (and event) will be reserved for CloseWatcher or other UA gestures.
Interestingly Android has a similar cancel Vs close situation but they do allow a cancel function for cancel buttons
https://github.com/openui/open-ui/discussions/950#discussioncomment-7593669 - this discussion suggests that our assumption of a UA only cancel event isn't necessarily correct.
Semi related to this I've raised https://github.com/whatwg/html/issues/10164 - to discuss adding a new requestClose()
(name tbd) function to dialogs, if this is added we should update the 'cancel' name to be requestClose to match.
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.
Somewhat related to https://github.com/openui/open-ui/issues/937.
In the explainer today there exists a
cancel
action for dialog, which cancels the dialog (in other words it fires thecancel
andclose
events, not just theclose
event).Should we keep this? The cancel event is fired when a CloseWatcher closes a dialog, it currently doesn't fire for buttons, so having these buttons cancel the dialog would be somewhat new behaviour.
My vote is that we should remove this, and
cancel
can be kept as an observation of the CloseWatcher behaviour, but I'd like to hear others' thoughts./cc @lukewarlow @mfreed7 @scottaohara @domenic