Fix enter behavior

pull/16607/head
Diego Sampaio 6 years ago
parent 5bce20ee7e
commit 48ed2fba30
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 9
      app/ui-utils/client/lib/modal.js

@ -168,12 +168,7 @@ export const modal = {
instance.close();
}
if (!document.querySelector('.rc-modal__content').contains(event.target)) {
return;
}
if (instance && instance && instance.confirmOnEnter && event.key === 'Enter') {
if (instance && instance.confirmOnEnter && event.key === 'Enter') {
event.preventDefault();
event.stopPropagation();
@ -220,6 +215,8 @@ Template.rc_modal.onRendered(function() {
if (this.data.input) {
$('.js-modal-input', this.firstNode).focus();
} else if (this.data.showConfirmButton && this.data.confirmOnEnter) {
$('.js-confirm', this.firstNode).focus();
}
this.data.closeOnEscape && document.addEventListener('keydown', modal.onKeyDown);

Loading…
Cancel
Save