mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Accessibility: Fix text field character count and line navigation
Two fixes for text field accessibility: 1. Fix character count being off by one due to trailing newline always being appended to the last line. Add `is_last_line` parameter to `accessibility_create_sub_text_edit_elements()` to control this. 2. Link adjacent TextRuns via `previous_on_line`/`next_on_line` so screen readers can properly navigate lines. Without these links, AccessKit treats each TextRun as a separate line, causing incorrect announcements when arrowing through multi-line text.
This commit is contained in:
@@ -34,8 +34,10 @@
|
||||
<param index="1" name="shaped_text" type="RID" />
|
||||
<param index="2" name="min_height" type="float" />
|
||||
<param index="3" name="insert_pos" type="int" default="-1" />
|
||||
<param index="4" name="is_last_line" type="bool" default="false" />
|
||||
<description>
|
||||
Creates a new, empty accessibility sub-element from the shaped text buffer. Sub-elements are freed automatically when the parent element is freed, or can be freed early using the [method accessibility_free_element] method.
|
||||
If [param is_last_line] is [code]true[/code], no trailing newline is appended to the text content. Set to [code]true[/code] for the last line in multi-line text fields and for single-line text fields.
|
||||
</description>
|
||||
</method>
|
||||
<method name="accessibility_element_get_meta" qualifiers="const">
|
||||
|
||||
Reference in New Issue
Block a user