ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.96k stars 13.51k forks source link

feat: Improve ion-reorder accessibility #29296

Open dpalou opened 6 months ago

dpalou commented 6 months ago

Prerequisites

Describe the Feature Request

I'm not an accessibility expert so I might be wrong, but I think ion-reorder is not accessible. Some of the things that could be improved are:

Describe the Use Case

As a visual impaired user, I want to be able to use ion-reorder easily (using Talkback/Voiceover or a keyboard).

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

This is the template I used, in case it's helpful:

<ion-reorder-group [disabled]="dragDisabled" (ionItemReorder)="handleReorder($event.detail)">
    @for (item of items; track $index) {
      <ion-card>
          <ion-item class="ion-text-wrap">
              <ion-label [id]="item.id">
                  {{ item.label }}
              </ion-label>
              <ion-reorder [attr.aria-labelledby]="item.id" slot="end" />
          </ion-item>
      </ion-card>
    }
</ion-reorder-group>

Additional Information

No response

liamdebeasi commented 6 months ago

Hey there,

Can you provide a full code sample that I can use to reproduce each behavior?

dpalou commented 6 months ago

Hi Liam,

if you mean some code for each of the possible improvements, right now I haven't done anything to improve them (besides adding an aria-label to ion-reorder). We might add some elements on top of ion-reorder to fix some of the accessibility issues (I still need to talk about this with our UX), I'll be happy to share the code with you once I'm done.

If you mean some code to reproduce the problems, our app is quite complex so it wouldn't be easy for you to replicate it with our code. But basically adding ion-reorder anywhere would have those accessibility problems.

Thank you!

FabianGutierrezOpengov commented 3 months ago

@liamdebeasi our accessibility team is also looking for this, at least the ability of using keyboard to reorder. I provided a quick sample where I added tabindex to the ion-reorder element, but this doesnt feel like a something to "fix" but an important missing accessibility feature as kindly established by @dpalou

https://stackblitz.com/edit/angular-cc5twc-xutyk1?file=src%2Fapp%2Fexample.component.html

In any case if you need more feedback, happy to help.

have a good day :)

liamdebeasi commented 3 months ago

Hey there,

I no longer work on Ionic Framework, so I won't be much help in moving this along. Thanks for creating this demo though! This will be helpful for the dev team to better understand this feature request.