How to change the default behavior of search results dropdown list?

Problem described below happens on Android smartphone, thus limited screen space.

When searching for something in a big wiki, and there are many results, that produces a big dropdown list that is a few screens long. After I tap on a tiddler title from the search results to open that tiddler, the dropdown list stays open, covering the whole story river. To make the list disappear, I have to navigate back to the search widget and delete the search string. Is there a setting or something, to make the list of search results disappear automatically when an item from it is opened?

Edit the shadow tiddler $:/core/ui/SideBarSegments/search

Find this line:

<$reveal tag="div" class="tc-block-dropdown tc-search-drop-down tc-popup-handle" state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">

and remove “tc-popup-handle” from the class attribute value. This will cause the dropdown list to close as soon as you click on a tiddler link.

Also, if you want to limit the height of the dropdown list, you can create a tiddler, tagged with $:/tags/Stylesheet, containing the following CSS:

.tc-search-drop-down {  max-height:50vh;overflow:auto; }

This will ensure that the dropdown list will never be taller than half the browser window height, and will show a scrollbar if the list contents are longer than that.

enjoy,
-e

1 Like

I also have been frustrated by this on mobile before, so attempted removing tc-popup-handle – that did not work for me. I’ll be interested if it works for you @vuk

Both suggestions above work for me. In either Tiddloid or Vivaldi.

The tc-popup-handle classname occurs TWICE in the $:/core/ui/SideBarSegments/search tiddler.

The first is applied to the search input field itself, and should remain.

It is the second instance, which is applied to the $reveal widget that surrounds the dropdown results list that should be removed. Perhaps you removed the wrong one in your prior attempt?

-e


The one immediately preceding <<search-results-list>> right?

My best guess off the top of my head is I’ve redefined one of those other classes somewhere else along the way.

Ye gods, man, you messed with a .tc-something? Have you no respect!?

Perhaps go this route or similar…

.tc-popup-handle.my-tc-popup-handle, .my-tc-popup-handle {
  whatever:your;
  heart:desires;
}

Else there be dragons! or something :laughing:

@CodaCoder where did you ever get the misconception that I ever had any respect? :stuck_out_tongue_winking_eye: