ensemble icon indicating copy to clipboard operation
ensemble copied to clipboard

Support for Accessibility

Open amin-nas opened this issue 1 year ago • 3 comments

See this widget for reference: https://docs.flutter.dev/ui/accessibility-and-internationalization/accessibility?tab=browsers

amin-nas avatar Feb 09 '24 14:02 amin-nas

Proposed EDL:

widget:
    semantics:
        focused: true         //specify if a rectangle appears around the widget individually
        label: 'This is label of widget that'll be spoken out'
        hint: 'hint for the widget'

Umair-Manzoor-47 avatar Mar 21 '25 18:03 Umair-Manzoor-47

widget: semantics: focused: true //specify if a rectangle appears around the widget individually

  1. is it focused or focusable ? shouldn't a box always appear for the node that is focused?
  2. what is the purpose of the hint if it is not going to be read by screen reader?

amin-nas avatar Mar 21 '25 18:03 amin-nas

@amin-nas We have widget content: i.e, label, description, input value etc And reader reads it in this order.

      label: "Label",    // spoken before widget content 
      hint: "Hint",      // spoken After widget content 
      focusable: true ,  // optionally if property must be skipped in readers default true.

Comparison Table

Property Purpose When to Use When to Skip
label Describes what the element is for screen readers. - When an element does not have text (e.g., an icon button).
- When an image or visual element needs a meaningful description.
- When the element already has a visible text label.
- When the element is purely decorative and does not require an announcement.
hint Provides extra guidance about what an element does. - When the label alone is not enough to explain the interaction.
- When the user needs instructions on how to interact (e.g., "Double tap to delete").
- When the action is already clear from the label (e.g., "Logout" button).
- When used on purely decorative elements.
focusable Makes a non-interactive element focusable by assistive technologies. - When a non-focusable widget needs to be accessible (e.g., Text).
- When improving keyboard navigation for accessibility.
- When making important content discoverable by screen readers.
- When the element is already focusable (e.g., buttons, text fields).
- When the element is decorative and should be ignored.

When to Use and Skip These Properties

  • Use label when a widget has no text but needs to be described.
  • Use hint when extra instructions are needed for an interactive element.
  • Use focusable when making static elements like Text selectable for accessibility.

Umair-Manzoor-47 avatar Mar 24 '25 06:03 Umair-Manzoor-47