q-dialog accidental 'enter' key press issue
-
I have a situation where i need to confirm a delete operation, I faced an issue with q-dialog is that if the user accidentally presses ‘Enter’ key then is treated as ‘onOk’. i want to execute ‘onCancel’ as default for ‘enter’ key.
How can I achieve this?
-
Instead you could use the more customizable QDialog component( Instead of the dialog plugin ):
https://quasar.dev/vue-components/dialog -
@dobbel yes i am using it, but for small confirmations and prompts i have made a function with q-dialog plugin, in a mixin to reuse everywhere.
-
@s-molinari Can we set autofocus to ‘cancel’ instead of ‘ok’ so that accidental ‘enter’ keypress event can be treated as cancelled.