I have a link as parent with display: flex and all children have different order with css.
With NVDA when the focus is on the link, the screen reader read all content following the DOM order.
On Mac with VoiceOver, the screenreader follow the order on the screen and not the DOM order.
How can i fix it?
a {
display: flex;
}
div {
order: 0;
}
h2 {
order: 1;
}
<a href="#">
<h2>Title</h2>
<div>
<span>€ 300</span>
</div>
</a>
On windows, on focus i get: Title 300€
On Mac, on focus i get: 300€ Title
You can't fix this.
Any media, other than visual, that adheres to the order rules is non-conforming. You rely on non-conforming implementations at your own risk (i.e., the behavior can change at any time).
From the flexbox specification:
5.4.1. Reordering and Accessibility
The
orderproperty does not affect ordering in non-visual media (such as speech). Likewise,orderdoes not affect the default traversal order of sequential navigation modes (such as cycling through links, see e.g. tabindex).Authors must use
orderonly for visual, not logical, reordering of content. Style sheets that useorderto perform logical reordering are non-conforming.Note: This is so that non-visual media and non-CSS UAs, which typically present content linearly, can rely on a logical source order, while order is used to tailor the visual order. (Since visual perception is two-dimensional and non-linear, the desired visual order is not always logical.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With