swisspost / design-system

The Swiss Post Design System pattern library for a consistent and accessible user experience across the web platform.
https://design-system.post.ch
Apache License 2.0
111 stars 14 forks source link

Invalid input number displays an icon even when the width is too small for content #2119

Closed imagoiq closed 7 months ago

imagoiq commented 8 months ago

https://github.com/swisspost/design-system/assets/12294151/5aaac88b-dffe-4342-9c5e-f6760b7acbff

For the context (the error icon has been disabled temporarily): image

gfellerph commented 8 months ago
imagoiq commented 7 months ago

I'm wondering if this icon is really necessary. In practice, we should have a validation message (not like in this video). So we have an element indicating that's something is wrong for colour-blind people. Gov.uk seems to follow this way: https://design-system.service.gov.uk/components/error-summary/ https://design-system.service.gov.uk/components/text-input/#error-messages

But I also agree with the fact that icon is a good addition and easier to get the context. Another idea would be to include the icon as a prefix of the validation message.

Another question: should we treat this pattern as something rare and unique, and have its own solution?

Alternatively, perhaps we should design or think differently this pattern and rather have only one field? https://chriscoyier.net/2023/12/04/html-css-for-a-one-time-password-input/ https://designsystem.digital.gov/components/input-mask/

imagoiq commented 7 months ago

Result of discussion in the "Design System Patterns Discussion" meeting of today: have a UX look at the use case, it's possible that the use case can be improved without changing the pattern.