1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-31 18:08:03 +00:00

Integrate keyboard-driven-input in menubar-search (#4752)

This commit is contained in:
Simon Huber
2020-07-14 13:32:40 +02:00
committed by GitHub
parent 5b2048fad1
commit d66725fd31

View File

@@ -4,14 +4,19 @@ description: Search
caption: Search
tags: $:/tags/MenuBar
<$set name="searchTiddler" value="$:/temp/menubarsearch">
\define cancel-search-actions() <$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/>
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
\whitespace trim
<$vars searchTiddler="$:/temp/menubarsearch/input" searchListState=<<qualify "$:/state/search-list/selected-item">> titleSearchFilter="[!is[system]search:title<userInput>sort[title]limit[250]]" allSearchFilter="[!is[system]search<userInput>sort[title]limit[250]]">
<span style="margin: 0 0.5em;">
<$edit-text tiddler=<<searchTiddler>> tag="input" type="search" focusPopup="$:/state/popup/menubar-search-dropdown" class="tc-popup-handle tc-menu-show-when-wide" placeholder="Search..." default="" cancelPopups="yes"/>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/menubarsearch" storeTitle=<<searchTiddler>> selectionStateTitle=<<searchListState>>
refreshTitle="$:/temp/menubarsearch/refresh" tag="input" type="search" focusPopup="$:/state/popup/menubar-search-dropdown"
class="tc-popup-handle tc-menu-show-when-wide" placeholder="Search..." default="" cancelPopups="yes"
primaryListFilter=<<titleSearchFilter>> secondaryListFilter=<<allSearchFilter>> inputAcceptActions=<<input-accept-actions>>
inputCancelActions=<<cancel-search-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
</span>
<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/state/popup/menubar-search-dropdown" type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-search-drop-down">
@@ -30,4 +35,4 @@ tags: $:/tags/MenuBar
</$reveal>
</$set>
</$vars>