Skip to content

Consider conversion of data-/aria- prefixed keys to nested variants #1

@peteryates

Description

@peteryates

In Rails there are two ways of setting data and aria attributes when using the tag and content_tag helpers. These are to set the attribute by its full name data-controller: "abc", data-response: "xyz" or to use a nested hash: data: { controller: "abc", response: "xyz" }.This library, and both the components and form builder assume people are using the latter. Using the former might lead to unintended consequences.

It might make sense to detect the full name variant and either apply a conversion or provide some kind of warning to the developer. As this only applies to data- and aria- prefixed attributes the conversion should be straightforward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions