UX: alert screen readers when there is an issue saving a post (#13182)
* UX: alert screen readers when there is an issue saving a post Adds a "alert" role to various popup-input-tips. This means screen reader users can now tell why a post refuses to save. Also ensures like icon in the "try the like button" has screen reader support
This commit is contained in:
parent
1270c7ad15
commit
2f12c0f5bd
|
@ -269,7 +269,11 @@ export default Component.extend({
|
||||||
if (tl === 0 || tl === 1) {
|
if (tl === 0 || tl === 1) {
|
||||||
reason +=
|
reason +=
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
I18n.t("composer.error.try_like", { heart: iconHTML("heart") });
|
I18n.t("composer.error.try_like", {
|
||||||
|
heart: iconHTML("heart", {
|
||||||
|
label: I18n.t("likes_lowercase", { count: 1 }),
|
||||||
|
}),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { iconHTML } from "discourse-common/lib/icon-library";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNameBindings: [":popup-tip", "good", "bad", "lastShownAt::hide"],
|
classNameBindings: [":popup-tip", "good", "bad", "lastShownAt::hide"],
|
||||||
|
attributeBindings: ["role"],
|
||||||
animateAttribute: null,
|
animateAttribute: null,
|
||||||
bouncePixels: 6,
|
bouncePixels: 6,
|
||||||
bounceDelay: 100,
|
bounceDelay: 100,
|
||||||
|
@ -12,6 +13,13 @@ export default Component.extend({
|
||||||
closeIcon: `${iconHTML("times-circle")}`.htmlSafe(),
|
closeIcon: `${iconHTML("times-circle")}`.htmlSafe(),
|
||||||
tipReason: null,
|
tipReason: null,
|
||||||
|
|
||||||
|
@discourseComputed("bad")
|
||||||
|
role(bad) {
|
||||||
|
if (bad) {
|
||||||
|
return "alert";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
click() {
|
click() {
|
||||||
this.set("shownAt", null);
|
this.set("shownAt", null);
|
||||||
this.set("validation.lastShownAt", null);
|
this.set("validation.lastShownAt", null);
|
||||||
|
|
Loading…
Reference in New Issue