mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 21:19:41 -06:00
FIX: aria label for popup-input-tip (#15724)
popup-input-tip is used for composer validation. Aria label is essential to for accessibility. Also, HTML tags have to be removed
This commit is contained in:
parent
bb01563682
commit
a1adc13125
@ -5,7 +5,7 @@ import { getOwner } from "discourse-common/lib/get-owner";
|
||||
|
||||
export default Component.extend({
|
||||
classNameBindings: [":popup-tip", "good", "bad", "lastShownAt::hide"],
|
||||
attributeBindings: ["role"],
|
||||
attributeBindings: ["role", "ariaLabel"],
|
||||
rerenderTriggers: ["validation.reason"],
|
||||
tipReason: null,
|
||||
lastShownAt: or("shownAt", "validation.lastShownAt"),
|
||||
@ -19,6 +19,11 @@ export default Component.extend({
|
||||
}
|
||||
},
|
||||
|
||||
@discourseComputed("validation.reason")
|
||||
ariaLabel(reason) {
|
||||
return reason?.replace(/(<([^>]+)>)/gi, "");
|
||||
},
|
||||
|
||||
click() {
|
||||
this.set("shownAt", null);
|
||||
const composer = getOwner(this).lookup("controller:composer");
|
||||
|
Loading…
Reference in New Issue
Block a user