forked from MapComplete/MapComplete
UI: fix #1848, explicitly add element to help screen readers pronounce everything correctly
This commit is contained in:
parent
cecfaebf5b
commit
9832aa45f0
6 changed files with 94 additions and 35 deletions
|
|
@ -118,6 +118,7 @@ export default class WikidataPreviewBox extends VariableUiElement {
|
|||
return new FixedUiElement(maybeWikidata["error"]).SetClass("alert")
|
||||
}
|
||||
const wikidata = <WikidataResponse>maybeWikidata["success"]
|
||||
console.log(">>>> got wikidata", wikidata)
|
||||
return WikidataPreviewBox.WikidataResponsePreview(wikidata, options)
|
||||
})
|
||||
)
|
||||
|
|
@ -131,6 +132,8 @@ export default class WikidataPreviewBox extends VariableUiElement {
|
|||
extraItems?: (BaseUIElement | string)[]
|
||||
}
|
||||
): BaseUIElement {
|
||||
console.log(">>> constructing wikidata preview box", wikidata.labels)
|
||||
|
||||
const link = new Link(
|
||||
new Combine([
|
||||
wikidata.id,
|
||||
|
|
@ -143,13 +146,12 @@ export default class WikidataPreviewBox extends VariableUiElement {
|
|||
Wikidata.IdToArticle(wikidata.id),
|
||||
true
|
||||
)?.SetClass("must-link")
|
||||
|
||||
let info = new Combine([
|
||||
new Combine([
|
||||
Translation.fromMap(wikidata.labels)?.SetClass("font-bold"),
|
||||
link,
|
||||
]).SetClass("flex justify-between flex-wrap-reverse"),
|
||||
Translation.fromMap(wikidata.descriptions),
|
||||
Translation.fromMap(wikidata.descriptions, true),
|
||||
WikidataPreviewBox.QuickFacts(wikidata, options),
|
||||
...(options?.extraItems ?? []),
|
||||
]).SetClass("flex flex-col link-underline")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue