Skip to content

Commit 17207b0

Browse files
DataTrinytronical
authored andcommitted
Make accessible-position-in-set zero-based
1 parent 97219c2 commit 17207b0

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

docs/reference/src/language/builtins/elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Use the following `accessible-` properties to make your items interact well with
7878
- **`accessible-placeholder-text`** (_in_ _string_): A placeholder text to use when the item's value is empty. Applies to text elements.
7979
- **`accessible-selectable`** (_in_ _bool_): Whether the element can be selected or not.
8080
- **`accessible-selected`** (_in_ _bool_): Whether the element is selected or not. This maps to the "is-selected" state of listview items.
81-
- **`accessible-position-in-set`** (_in_ _int_): The index (starting from 1) of this element in a group of similar elements. Applies to list items, radio buttons and other elements.
81+
- **`accessible-position-in-set`** (_in_ _int_): The index (starting from 0) of this element in a group of similar elements. Applies to list items, radio buttons and other elements.
8282
- **`accessible-size-of-set`** (_in_ _int_): The total number of elements in a group. Applies to all elements of a group like list items, radio buttons and other elements, but not to their parent container like list views, radio button groups or other grouping elements.
8383

8484
You can also use the following callbacks that are going to be called by the accessibility framework:

internal/compiler/widgets/cosmic/components.slint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export component ListItem {
107107
accessible-label: root.item.text;
108108
accessible-selectable: true;
109109
accessible-selected: root.is-selected;
110-
accessible-position-in-set: root.index + 1;
110+
accessible-position-in-set: root.index;
111111
accessible-size-of-set: root.total-items;
112112

113113
states [

internal/compiler/widgets/cupertino/components.slint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export component ListItem {
6363
accessible-label: root.item.text;
6464
accessible-selectable: true;
6565
accessible-selected: root.is-selected;
66-
accessible-position-in-set: root.index + 1;
66+
accessible-position-in-set: root.index;
6767
accessible-size-of-set: root.total-items;
6868

6969
states [

internal/compiler/widgets/fluent/components.slint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export component ListItem {
5151
accessible-label: root.item.text;
5252
accessible-selectable: true;
5353
accessible-selected: root.is-selected;
54-
accessible-position-in-set: root.index + 1;
54+
accessible-position-in-set: root.index;
5555
accessible-size-of-set: root.total-items;
5656

5757
states [

internal/compiler/widgets/material/components.slint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export component ListItem {
109109
accessible-label: root.item.text;
110110
accessible-selectable: true;
111111
accessible-selected: root.is-selected;
112-
accessible-position-in-set: root.index + 1;
112+
accessible-position-in-set: root.index;
113113
accessible-size-of-set: root.total-items;
114114

115115
states [

0 commit comments

Comments
 (0)