Skip to content

BasesSearchMenu

Unofficial

The search menu of a obsidian#QueryController’s toolbar, providing the in-view search bar that filters results by a full-text query.

Import:

import type { BasesSearchMenu } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface BasesSearchMenu extends Component

Extends: Component

Constructor

new BasesSearchMenu()

Constructor.

To extract the constructor type, use ExtractConstructor<Component>.

Properties

PropertyTypeDescription
_childrenComponent[]Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from Component)
_eventsEventRef[]Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from Component)
_isOpenbooleanWhether the search bar is currently open.
_loadedbooleanWhether the component and its children are loaded.
(Inherited from Component)
appAppThe app instance.
buttonunknownThe toolbar button that toggles the search bar.
countElHTMLDivElementThe element displaying the search result count.
inputElHTMLInputElementThe search input element.
queryControllerQueryControllerThe owning query controller.
scopeScopeThe keyboard scope active while the search bar is open (registers Escape to close it).
searchBarElHTMLDivElementThe search bar container element.
updateDebouncer<[string], void>Debounced update that pushes the typed query to the controller via obsidian#QueryController.updateSearchQuery.

Methods

MethodReturnsDescription
addChild(component)TAdds a child component, loading it if this component is loaded.
(Inherited from Component)
close()voidCloses the search bar.
load()voidLoad this component and its children.
(Inherited from Component)
onload()voidOverride this to load your component.
(Inherited from Component)
onunload()voidOverride this to unload your component
(Inherited from Component)
open()voidOpens the search bar, focuses the input, and pushes the keyboard scope.
register(cb)voidRegisters a callback to be called when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from Component)
registerEvent(eventRef)voidRegisters an event to be detached when unloading.
(Inherited from Component)
registerInterval(id)numberRegisters an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
(Inherited from Component)
registerScopeEvent(keymapEventHandler)voidRegister a scope keymap event handler to be removed on unload.
(Inherited from Component)
removeChild(component)TRemoves a child component, unloading it.
(Inherited from Component)
toggle()voidToggles the search bar open or closed.
unload()voidOverride this to unload your component.
(Inherited from Component)
updateCount(entries)voidUpdates the displayed result count.

Links to this page: