From 11ae5399f667aec3fa00d99a0e5eeeeb3bafeb43 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Tue, 9 May 2023 10:52:02 +0300 Subject: [PATCH] make it so that custom context menu from contextMenu.js only disappears after user's click, ignoring non-user click events --- javascript/contextMenus.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/javascript/contextMenus.js b/javascript/contextMenus.js index 42f301ab..b2bdf053 100644 --- a/javascript/contextMenus.js +++ b/javascript/contextMenus.js @@ -92,8 +92,7 @@ contextMenuInit = function(){ return; } gradioApp().addEventListener("click", function(e) { - let source = e.composedPath()[0] - if(source.id && source.id.indexOf('check_progress')>-1){ + if(! e.isTrusted){ return }