HubSpot / vex

A modern dialog library which is highly configurable and easy to style. #hubspot-open-source
http://github.hubspot.com/vex/docs/welcome
MIT License
6.92k stars 491 forks source link

How to disable vex Submit with SPACE #254

Closed zMrSnow closed 6 years ago

zMrSnow commented 6 years ago

How to disable vex Submit with SPACE

bbatliner commented 6 years ago

Could you be more specific?

I think you're referring to the fact that if you press the spacebar after a dialog opens, it will close. This is a result of the focusFirstInput option for vex-dialog, which will autofocus the submit button (or another button) when the dialog opens. Then pressing space will click the button and the dialog will close.

Pass focusFirstInput: false to your dialog options and that should do it.