Skip to main content

Clear Text Content (ui_element.clear_text)

This function is available in versions after 20260507

Declaration

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

Parameters

  • selector_or_element Table. A selector, an element returned by a query, or a coordinate table { x = X, y = Y }.
  • 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

Clear a text input target. Whether a particular control accepts clearing depends on the current app screen.

Example

local ui_element = require("ui_element")

ui_element.clear_text({
title = "Search",
role = "text_field",
})