We've moved discussions to Discord

Double confirm dialogs when deleting resource.

Dan Weaver
I have a Delete button in a view partial and when clicked it shows the fancy confirmation dialog with the usual Cancel and Confirm buttons. However, if I hit RETURN instead of clicking Confirm the browser confirmation dialog also appears.

I guess when I hit RETURN it's triggering the default browser behavior for the delete button?

How can I fix this so I only see one confirmation dialog or the other? I really don't mind which at this point, I just don't want both.

https://dsc.cloud/weavermedia/Screen-Recording-2019-08-12-15-32-02
Chris Oliver
This should be fixed now. I have it changing the focus to the modal's confirm button now so when you hit Enter it will submit the confirm modal instead of triggering the Rails one. I also added Escape support to cancel the modal.
Notifications
You’re not receiving notifications from this thread.