-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(carousel): Improve accessibility - FRONT-3657 #2566
Conversation
0909509
to
f44486f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure that it wa what the accessibility expert had in mind when talking about "two buttons", but if that's validated by COMM...
@@ -7,7 +7,8 @@ | |||
- "sr_previous" (string) (default: 'Previous slides') screen reader label for previous button | |||
- "sr_next" (string) (default: 'Next slides') screen reader label for next button | |||
- "sr_navigation" (string) (default: 'Go to slide %d') screen reader label for navigation buttons | |||
- "sr_autoplay" (string) (default: 'Carousel auto play') screen reader label for autoplay button | |||
- "sr_play" (string) (default: 'Play carousel') screen reader label for the play button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could add a backward compatibility check, to use the value of the previous "sr_autoplay" by default
similar to what was done here https://github.com/ec-europa/europa-component-library/blob/v3.4.0-dev/src/implementations/twig/components/content-item/content-item.html.twig#L42
#{map.get(theme.$spacing, 's')} - #{$_outline-width} | ||
); | ||
} | ||
.ecl-carousel__autoplay { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so user no longer has the possibility to play/pause carousel on mobile? Is it on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is, here are the specs for touch screen: https://www.figma.com/file/wAuZXP2e9NUrsT5C1EKNEk/Carousel?node-id=428%3A32040
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They update the spec, so no autoPlay on mobile anymore 👍
} | ||
|
||
.ecl-carousel__prev { | ||
left: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that it should be inverted in the rtl css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already done in RTL CSS resource
@@ -225,6 +264,37 @@ $_outline-width: null !default; | |||
|
|||
.ecl-carousel__prev, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these buttons should be hidden on print
); | ||
} | ||
.ecl-carousel__autoplay { | ||
display: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the buttons don't disapear at the the same breakpoint as the mobile version, so there are some cases where you have the mobile display, but still have the button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's correct, https://www.figma.com/file/wAuZXP2e9NUrsT5C1EKNEk/Carousel?node-id=428%3A32040
@@ -31,14 +31,17 @@ export class Carousel { | |||
constructor( | |||
element, | |||
{ | |||
toggleSelector = '.ecl-carousel__toggle', | |||
playSelector = '.ecl-carousel__play', | |||
pauseSelector = '.ecl-carousel__pause', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why we use css class selector here instead of data attributes as on the other components, but that would require some quite big changes...
Probably for next major version of this component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I wanted to lighten the markup in a way... but indeed we'll have to align this as other components
inert
+tabindex='-1'
as a fallback)previous & next buttons are moved in the control bar for mobile format (JS)
todo: