From 10f9708fe01b4c4d2bb1743486d7768bee1f4173 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 (grafted from f295f3d8b14264e592a86cc505d04ffd1b21bcc6) --HG-- branch : 7.0 --- 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 ccda7200d5..0042fcb522 100644 --- a/sao/src/window.js +++ b/sao/src/window.js @@ -886,8 +886,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('