code: function setSelectable(item) {
              if (item.children) {
                  item.children.forEach(setSelectable);
              }
              if (item.submenu) {
                  item.selectable = !!item.selectable;
              }
          }
docs: makes sure any result item with a submenu that's not explicitly set as selectable becomes unselectable