[FIX] web: no quick edit on mouse text selection

Do not trigger quick edit when we are selection text with mouse:

- click and holding to select text
- multiple clicks selecting text

Since click on an editable field now change the edit mode, we could no
longer select the text.

With this change, quick edit is delayed by a given delay and if the edit
mode is not enabled if:

- there is a subsequent click within the delay
- there is a text selection when the click event is handled

closes #68023

X-original-commit: 2939ea4dd4736e659cc3e4df2226a3b08ac8ec48
This commit is contained in:
Nicolas Lempereur
2021-03-22 16:59:38 +00:00
parent 0de75b228a
commit 0e004e1b7c
6 changed files with 112 additions and 5 deletions
@@ -6,6 +6,7 @@ var basicFields = require('web.basic_fields');
var concurrency = require('web.concurrency');
var config = require('web.config');
var core = require('web.core');
var FormController = require('web.FormController');
var FormView = require('web.FormView');
var KanbanView = require('web.KanbanView');
var ListView = require('web.ListView');
@@ -150,7 +151,14 @@ QUnit.module('basic_fields', {
}]
},
};
}
testUtils.mock.patch(FormController, {
'multiClickTime': 0,
});
},
afterEach() {
testUtils.mock.unpatch(FormController);
},
}, function () {
QUnit.module('DebouncedField');