当前位置: 首页 > 文档资料 > Tabris 中文文档 >

SearchAction

优质
小牛编辑
130浏览
2023-12-01

Extends Action

An action that displays a search text field with dynamic proposals when selected. Add a listener on select to implement the action. On input, you may set a list of proposals.

Import this type with “const {SearchAction} = require('tabris');

AndroidiOS
SearchAction on AndroidSearchAction on iOS

Methods

open()

Invokes the search action, i.e. displays the UI to perform a search.

Properties

message

Type: string

A hint text that is displayed when the search input is empty.

proposals

Type: string[], default: []

The list of proposals to display.

text

Type: string

The text in the search input field.

Events

accept

Fired when a text input has been submitted by pressing the keyboard’s search key.

Event Parameters

  • target: this The widget the event was fired on.

  • text: string The current value of text.

input

Fired when the user inputs text.

Event Parameters

  • target: this The widget the event was fired on.

  • text: string The new value of text.

messageChanged

Fired when the message property has changed.

Event Parameters

  • target: this The widget the event was fired on.

  • value: string The new value of message.

proposalsChanged

Fired when the proposals property has changed.

Event Parameters

  • target: this The widget the event was fired on.

  • value: string[] The new value of proposals.

textChanged

Fired when the text property has changed.

Event Parameters

  • target: this The widget the event was fired on.

  • value: string The new value of text.

See also