ryersondmp / sa11y

Sa11y is an accessibility quality assurance tool that visually highlights common accessibility and usability issues. Geared towards content authors, Sa11y straightforwardly identifies errors or warnings at the source with a simple tooltip on how to fix them.
https://sa11y.netlify.app
Other
280 stars 43 forks source link

List false positives in table cells #80

Closed gregrgay closed 4 months ago

gregrgay commented 4 months ago

We're finding a lot of list false positives in table cells, like those in the attached screenshot. Not sure why some, but not others. Times (e.g. 11:00 pm) get flagged, for instance, but not the row headers that have a "1. Bedtime" value, which looks more like a list item but isn't flagged. Would removing the check for paragraphs that start with numbers in table cells help remedy the issue? listFPs

There are cases where a cell might have a list in it, so perhaps one of the parameters for the check could be if there is more than one paragraph in a cell that starts with a number, flag as a possible list, otherwise ignore it. etc.

Here's the markup for the table to experiment with:

Table 9.1: Sleep Diary
 

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

Sunday

1. Bedtime

11:00 pm

11:30 pm

11:05 pm

10:35 pm

10:55 pm

12:15 am

10:15 pm

2. Time to fall asleep

25

20

40

60

35

15

95

3. Time awake during night

20

25

15

35

20

45

60

4. Wake time

7 am

7 am

7 am

7 am

7 am

8:40 am

7:50 am

5. Rise time

7:15 am

7:20 am

7 am

7:25 am

7:15 am

10:50 am

11:45 am

adamchaboryk commented 4 months ago

Thanks, Greg. I'll look into it

adamchaboryk commented 4 months ago

Fixed!

gregrgay commented 2 months ago

Though the issue has been largely fixed, I did come across another instance, but don't see what's causing it. There are a couple other similar tables on the same page, that do not get flagged.

screen1

Here's the markup for the offending table.

Price

Quantity Demanded

Total Revenue

Marginal Revenue

7

0

0

NA

6.50

1

6.50

6.50

6

2

12

5.50

5.50

3

16.50

4.50

5

4

20

3.50

4.50

5

22.50

2.50

4

6

24

1.50

3.50

7

24.50

0.50

3

8

24

–0.50

2.50

9

22.50

–1.50

itmaybejj commented 2 months ago

Hmmph ok I'll take a look

itmaybejj commented 2 months ago

@adamchaboryk this is only hitting in Sa11y. Check https://github.com/ryersondmp/sa11y/blob/master/src/js/utils/elements.js#L58 -- I select for p:not(table p).

adamchaboryk commented 2 months ago

Thanks for catching, @itmaybejj!!