(core) Clicking on a link in a cell won't open the editor.

Summary:
Simple click (a click on a already focused cell) was opening the editor
even though user clicked an anchor in the cell.

Test Plan: Added test

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: georgegevoian

Differential Revision: https://phab.getgrist.com/D4044
This commit is contained in:
Jarosław Sadziński
2023-09-14 16:58:05 +02:00
parent 2b11000457
commit be995d4857
2 changed files with 51 additions and 1 deletions

View File

@@ -102,7 +102,10 @@ function DetailView(gristDoc, viewSectionModel) {
// We authorize single click only on the value to avoid conflict with tooltip
this.onEvent(this.viewPane, 'click', '.g_record_detail_value', function(elem, event) {
var field = this.recordLayout.getContainingField(elem, this.viewPane);
// If the click was place in a link, we don't want to trigger the single click
if (event.target?.closest("a")) { return; }
const field = this.recordLayout.getContainingField(elem, this.viewPane);
if (
this._twoLastFieldIdsSelected[0] === this._twoLastFieldIdsSelected[1]
&& !isNarrowScreen()