Skip to main content

Append Text Input (ui_element.input_text)

This function is available in versions after 20260507

Declaration

ok, info_or_err = ui_element.input_text(selector_or_element, text [, options ])

Parameters

  • selector_or_element Table. A selector, an element returned by a query, or a coordinate table { x = X, y = Y }.
  • text String. Text to append.
  • options Optional, table. See Common options.

Returns

  • ok Boolean. true on success, nil on failure.
  • info_or_err Table on success, string failure reason on failure.

Description

This API locates a text input target and appends text. To replace existing text, use set_text.

Example

local ui_element = require("ui_element")

local ok, info_or_err = ui_element.input_text({
title = "Search",
role = "text_field",
}, "XXTouch")

if not ok then
sys.toast(info_or_err)
end

Note: Uses non-chapter API sys.toast.