From 2049c0f3767c82da90db79f709ae9648b0c7a930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 Jun 2024 09:41:46 +0200 Subject: [PATCH] Manually handle hiding of bootstrap Modals in search Closes #13330 --- sao/src/window.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sao/src/window.js b/sao/src/window.js index 0c304c35e4..9c2beb4843 100644 --- a/sao/src/window.js +++ b/sao/src/window.js @@ -920,8 +920,14 @@ this.title = title; this.exclude_field = kwargs.exclude_field || null; var dialog = new Sao.Dialog(Sao.i18n.gettext( - 'Search %1', this.title), '', 'lg'); + 'Search %1', this.title), '', 'lg', false); this.el = dialog.modal; + this.el.on('keydown', e => { + if (e.which == Sao.common.ESC_KEYCODE) { + e.preventDefault(); + this.response('RESPONSE_CANCEL'); + } + }); jQuery('