Replies: 3 comments 7 replies
-
Happy to see this! I wholeheartedly support an accessibility initiative for our UI library. I'm open to different ways of achieving this. Previous work2.5 years ago I wrote up a "minimum accessibility support" checklist that would've established a baseline of accessibility across our components. Looks like work on that has stalled, which perhaps is a consequence of the "require a lot more maintenance than native components" downside of custom components you mention above. Native componentsI am in favour of using native components where possible, the advantages for accessibility are worth it. Looking at the UI library, I'm not sure how many components we'd classify as "not native" though? For example, is our checkbox considered non-native because of the amount of customisation we've applied, even though it's still Regarding
Moving forwardI definitely want to see this initiative move forward, so I'd suggest a few next steps, if I may:
|
Beta Was this translation helpful? Give feedback.
-
As mentioned in the call I'm very in favor of accessibility improvements and this is something strategically we want to do. I don't think we should offer a separate component for native. If the functionality is the same, we should replace it under the hood of the existing component and spread props where possible (or offer namespaced passthrough props like I agree with @cooper-joe - I'm not sure there are that many components that could be native that aren't already... so other than prop spreading it's not clear to me which components would benefit from this proposal, would love to see the list! Probably even more important than prop-spreading from an accessibility standpoint is to improve the props we pass to the underlying native components (without requiring the app to pass those props) to ensure they are keyboard and screen-reader accessible by default. |
Beta Was this translation helpful? Give feedback.
-
I have setup the topic for the next DevEx meeting to discuss this proposal in details (January 11th). Few thoughts I have:
It would also be good to analyse what other UI libraries do in this space (especially ones focused on accessibility like radix-ui which is also unstyled), since a lot of these challenges are not specific to us. I think a general concern to address would also be whether we can provide components that are accessible by default, rather than ones that rely on the consumer to address accessibility (by using native components, or forwarding props).
I think the three points here from Joe are good way to head forward, so let's use them as a starting agenda for the meeting. |
Beta Was this translation helpful? Give feedback.
-
Current situation
We have a decent amount of custom input components. They:
Solution
We introduce styled native inputs. These provide a consistent DHIS2 branding, without the complexity or maintenance burden of our existing components and can be implemented quickly due to their simplicity and built-in features.
By allowing the new native components to be opt-in adoption can be gradual. We'll have time to figure out edge cases that can't be easily addressed by native components. But those that want to upgrade can easily do so.
This is also the easiest possible way to quickly have accessible components that cost very little to maintain. Besides that it paves the way for meeting accessibility requirements for our funding.
Background
There are two reasons for making this proposal now:
Funding
During our last team platform meeting, some peers mentioned that we'd have to improve our accessibility to continue to receive funding from some governments.
Blur events
4. React final form has a feature called "validate on blur", which improves forms' performance by only running validation when leaving a field. Some of our components have dropdowns (most notably the select components), which are rendered outside the DOM of the actual select component as we're using a combination of our
Layer
component (to manage z-axis layering) andPopper
(to ensure the dropdown is always in the viewport). This makes having a sane implementation for focusing and blurring the input component impossible. @ismay looked into the differences between our select components and native select inputs here. Changing the select so it implements the focus and blur specs of the native element requires using quirks and hacks (as clicking an option will trigger the blur event, which we have to suppress, we'd then have to refocus the actual select component without firing a focus event)Beta Was this translation helpful? Give feedback.
All reactions