diff --git a/addons/web/static/src/views/list/list_renderer.js b/addons/web/static/src/views/list/list_renderer.js index b33506e0cb9..0fe4fa41f1b 100644 --- a/addons/web/static/src/views/list/list_renderer.js +++ b/addons/web/static/src/views/list/list_renderer.js @@ -1695,17 +1695,14 @@ export class ListRenderer extends Component { return; } if (this.props.list.selection.length) { - // in selection mode, only selection is allowed. - ev.preventDefault(); - this.toggleRecordSelection(record); - } else { - this.touchStartMs = Date.now(); - if (this.longTouchTimer === null) { - this.longTouchTimer = browser.setTimeout(() => { - this.toggleRecordSelection(record); - this.resetLongTouchTimer(); - }, this.constructor.LONG_TOUCH_THRESHOLD); - } + ev.stopPropagation(); // This is done in order to prevent the tooltip from showing up + } + this.touchStartMs = Date.now(); + if (this.longTouchTimer === null) { + this.longTouchTimer = browser.setTimeout(() => { + this.toggleRecordSelection(record); + this.resetLongTouchTimer(); + }, this.constructor.LONG_TOUCH_THRESHOLD); } } onRowTouchEnd(record) { @@ -1753,6 +1750,24 @@ export class ListRenderer extends Component { * @param {HTMLElement} [params.group] */ sortStop() {} + + ignoreEventInSelectionMode(ev) { + const { list } = this.props; + if (this.env.isSmall && list.selection && list.selection.length) { + // in selection mode, only selection is allowed. + ev.stopPropagation(); + ev.preventDefault(); + } + } + + onClickCapture(record, ev) { + const { list } = this.props; + if (this.env.isSmall && list.selection && list.selection.length) { + ev.stopPropagation(); + ev.preventDefault(); + this.toggleRecordSelection(record); + } + } } ListRenderer.template = "web.ListRenderer"; diff --git a/addons/web/static/src/views/list/list_renderer.xml b/addons/web/static/src/views/list/list_renderer.xml index 040284c7a77..a6a9edbbd66 100644 --- a/addons/web/static/src/views/list/list_renderer.xml +++ b/addons/web/static/src/views/list/list_renderer.xml @@ -209,6 +209,10 @@