Skip to content

feature request: runtime validation of aria-attributes in dev mode. #223

@Gr8Gatsby

Description

@Gr8Gatsby

SOMA#814

Migrated issue

notes:

Some aria attributes (like aria-selected) are of type string, and we some times treat them as a boolean attribute. it would be a nice to have if we get a warning or an error at runtime for those attributes.

The compiler should complain when we have something like this:

<template>
     <x-foo aria-selected>something</x-foo>
<template>

because it should know that aria-selected is not a valid boolean attribute. At this point, it should tell you that possible values are: ="true" and ="false".

That itself is an enhancement on the compiler, and I doubt that it is doing so today. but this is not sufficient, because of:

<template>
     <x-foo aria-selected={computedValue}>something</x-foo>
<template>

In which case, we should have a runtime check to tell you that the value of this.computedValue should be a string value equal to "true" or "false".

The same apply to any boolean, or boolean-like global HTML attribute. this will help people to not trip down on these weird cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions