pklaschka/xd-dialog-helper

Bug: Pressing 'Enter' cancels the dialog instead of okaying it

ttmc opened this issue · 3 comments

ttmc commented

Description of the bug

When a generated dialog is open in Adobe XD and I press the Enter key on my keyboard, it has the same effect as clicking on the Cancel button (or pressing the Esc key). This is contrary to the Adobe XD user experience pattern given at:

https://adobexdplatform.com/plugin-docs/design/ux-patterns/modal-ux.html#key-commands

Meta-Data:

I'm using the xd-dialog-helper

  • Via npm (i.e. bundle it with webpack)
  • In its standalone-version (i.e. I've copied the dialog-helper.js file into my project)

Version: 1.0.5

Thank you for submitting this issue. I'll look into it asap (probably early next week).

May I ask on which platform you've noticed this behavior (macOS or Windows)? Thank you very much in advance 🙂.

ttmc commented

I noticed this behavior on my Windows 10 machine.

ttmc commented

I looked into fixing this bug, but I don't use TypeScript, so I got stuck.

However, I think I narrowed it down to the handling of form's submit event. Here's what the Adobe XD plugin reference docs say about that: https://adobexdplatform.com/plugin-docs/reference/ui/dialogs/dismissal.html

This Adobe XD sample code gives a more concrete example of how to do that. Look for form.onsubmit

And here's where the form's submit event gets handled in this project (i.e. in the source code):

form.onsubmit = actionList.close;

I hope that is enough of a lead for you to figure out what to fix in this project's source code.