Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/compiler/widgets/common/datepicker_base.slint
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ component CalendarDelegate {
accessible-role: button;
accessible-checkable: true;
accessible-checked: root.selected;
accessible-enabled: root.enabled;
accessible-label: root.text;
accessible-action-default => { touch-area.clicked(); }
accessible-action-default => { if (root.enabled) { touch-area.clicked(); } }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @DataTriny Do you know if this is needed or if it's fair to assume that accessible-action-default be invoked on elements where accessible-enabled is false?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tronical AFAIK platform accessibility stacks don't really care, AccessKit (inconsistently for now) enforce this check when the API wants a confirmation, but in any case we take decision based on the latest tree update we received from Slint, which may not reflect the current state. Therefore it's safer to do this check at the toolkit level.


touch-area := TouchArea {
enabled: root.enabled;
Expand Down
6 changes: 4 additions & 2 deletions internal/compiler/widgets/common/internal-components.slint
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export component IconButton {
min-width: max(48px, content-layer.min-width);
min-height: max(48px, content-layer.min-height);
accessible-role: button;
accessible-action-default => { touch-area.clicked(); }
accessible-enabled: root.enabled;
accessible-action-default => { if (root.enabled) { touch-area.clicked(); } }
forward-focus: touch-area;

touch-area := FocusTouchArea {
Expand Down Expand Up @@ -121,8 +122,9 @@ export component SelectionButton {
accessible-label: root.text;
accessible-role: button;
accessible-checkable: true;
accessible-enabled: root.enabled;
accessible-checked: root.checked;
accessible-action-default => { touch-area.clicked(); }
accessible-action-default => { if (root.enabled) { touch-area.clicked(); } }
forward-focus: touch-area;

touch-area := FocusTouchArea {
Expand Down
Loading