Skip to content

Accessibility support #465

@dmurdoch

Description

@dmurdoch

By default, htmlwidgets are wrapped in <div> tags, which don't support "alt" attributes for explanatory text. In yihui/knitr#2243 I have proposed that htmlwidgets which use the "aria-labelledby" attribute should get a text label added, which (at least some) screen readers will treat like alt text.

I can do this for the rgl widget by adding a widget_html.rglWebGL() function (https://github.com/dmurdoch/rgl/blob/635349d8c2c7deef5fcfa292340c93fb254a3286/R/rglwidget.R#L401-L404) but maybe this should be added by the htmlwidgets:::widget_html.default() function (

htmlwidgets/R/htmlwidgets.R

Lines 287 to 293 in e234c0e

widget_html.default <- function (name, package, id, style, class, inline = FALSE, ...) {
if (inline) {
tags$span(id = id, style = style, class = class)
} else {
tags$div(id = id, style = style, class = class)
}
}
), probably conditional on some setting in the widget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions