mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Show default context menu on link
Summary: also: - closes opened menu if any when click on a custom widget - closes opened menu if any when F2 Test Plan: Include test case Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3269
This commit is contained in:
@@ -24,6 +24,9 @@ export function gristLink(href: string|Observable<string>, ...args: IDomArgs<HTM
|
||||
dom.attr("href", href),
|
||||
dom.attr("target", "_blank"),
|
||||
dom.on("click", ev => onClickHyperLink(ev, typeof href === 'string' ? href : href.get())),
|
||||
// stop propagation to prevent the grist custom context menu to show up and let the default one
|
||||
// to show up instead.
|
||||
dom.on("contextmenu", ev => ev.stopPropagation()),
|
||||
// As per Google and Mozilla recommendations to prevent opened links
|
||||
// from running on the same process as Grist:
|
||||
// https://developers.google.com/web/tools/lighthouse/audits/noopener
|
||||
|
||||
Reference in New Issue
Block a user