Comments (3)
I agree it would be great to be accessible by default. A PR would be greatly appreciated!
from toasty.
I'm looking at this and it's a little more involved than I thought.
I think it's easy to have what-you-probably-want defaults like aria-atomic="true"
and role="alert"
and aria-live="polite"
. But maybe this should be something in a Toasty.Accessibility
module rather than the actual defaults? You can overwrite these defaults if the attribute 'setters' were 'appenders', but that's not how they work now.
For me, the bigger deal is that each alert should be allowed to have its own politeness -- meaning like inf are 'polite' whereas error are 'assertive'. I had started with a politeness ADT type Politeness = Polite | Assertive | Off
. One way to do this would be to pass in yet another functions from a -> Politeness
where that a
is the a
in Stack a
(like the view in the example). This would make the render have yet another argument which would be more to think about as well as make this a breaking change. An Accessibility module could wrap these pieces together, but my question is: do you want to enforce consumers to do a11y or make it opt-in? I can see the arguments for both.
from toasty.
What I mean by that is that is, if there were an Accessibility module added to this, it would likely be the preferred/best practice way to use this library. The basic form may be easier to work with, but should it be?
from toasty.
Related Issues (7)
- Toasts can close prematurely due to ID collision HOT 5
- Demo does not work on mobile HOT 3
- Expose Msg with Msg(...) HOT 3
- Ability to conditionally show toasts HOT 3
- Elm 0.19 HOT 4
- Remove toasts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toasty.