From 9883aaaef8eb62d808c4a9abe4636fd3316158ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 10 Feb 2019 13:16:33 +0100 Subject: [PATCH] Ignore operators on readonly date widget Readonly date should not be modified by operators. issue7932 review47791002 --- src/view/form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/view/form.js b/src/view/form.js index c9199a14b0..cdc46068e7 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1525,6 +1525,9 @@ function eval_pyson(value){ var mousetrap = new Mousetrap(this.el[0]); mousetrap.bind(['enter', '='], function(e, combo) { + if (this.date.find('input').prop('readonly')) { + return; + } if (e.which != Sao.common.RETURN_KEYCODE) { e.preventDefault(); } @@ -1533,6 +1536,9 @@ function eval_pyson(value){ Sao.common.DATE_OPERATORS.forEach(function(operator) { mousetrap.bind(operator[0], function(e, combo) { + if (this.date.find('input').prop('readonly')) { + return; + } e.preventDefault(); var dp = this.date.data('DateTimePicker'); var date = dp.date();