From 69a6a07d11bdc86b47b4c547afeedcbf8e47907a Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 3 Aug 2018 11:26:22 -0300 Subject: Don't show menu if it doesn't contain any items --- ui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui.js b/ui.js index 970adbf..99039cf 100644 --- a/ui.js +++ b/ui.js @@ -1432,6 +1432,11 @@ class ContextMenu extends FocusElement { } show({x = 0, y = 0, items}) { + items = items.filter(Boolean) + if (!items.length) { + return + } + // This *should* work with a menu action which opens the menu again, // because the selected element will be restored before the menu is // opened the second time. -- cgit 1.3.0-6-gf8a5