DEV Community

Discussion on: 5 star rating system - ACTUALLY accessible, no JS, no WAI-ARIA and Semantic HTML! ⭐⭐⭐⭐⭐ [Easily converted to any framework too!]

Collapse
 
mindplay profile image
Rasmus Schultz

Very cool!

Didn't work quite correctly with touch on a mobile phone though. Look here what happens if you tap and drag over the control, trying to scroll the page - it gets into some very weird states.

dev-to-uploads.s3.amazonaws.com/up...

Collapse
 
grahamthedev profile image
GrahamTheDev

If you click elsewhere it would be fine, the red stars are for hover state and so you activated that.

I don’t think I ever saw someone drag on a star rating before but if you expect it to happen we can use media queries to fix it easily

Collapse
 
mindplay profile image
Rasmus Schultz

People will put their finger anywhere in the screen to scroll, because this does not normally translate to interactions with controls. I can put my finger on the submit-button in this comment form and scroll the page. This is fundamental to how touch interactions are expected to work, so it's going to look like a bug when it happens. Most internet devices are touch devices, so keeping things touch friendly is important when we design custom controls. 🙂