Skip to content

Commit

Permalink
Map input[value] to aria-valuenow (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jym77 authored Sep 13, 2021
1 parent 937adb6 commit d719758
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions packages/alfa-aria/src/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,14 @@ const Features: Features = {
yield Attribute.of("aria-controls", value);
}

// https://w3c.github.io/html-aam/#att-max-input
for (const { value } of element.attribute("max")) {
yield Attribute.of("aria-valuemax", value);
// https://w3c.github.io/html-aam/#att-disabled
for (const _ of element.attribute("disabled")) {
yield Attribute.of("aria-disabled", "true");
}

// https://w3c.github.io/html-aam/#att-min-input
for (const { value } of element.attribute("min")) {
yield Attribute.of("aria-valuemin", value);
// https://w3c.github.io/html-aam/#att-placeholder
for (const { value } of element.attribute("placeholder")) {
yield Attribute.of("aria-placeholder", value);
}

// https://w3c.github.io/html-aam/#att-readonly
Expand All @@ -436,14 +436,20 @@ const Features: Features = {
yield Attribute.of("aria-required", "true");
}

// https://w3c.github.io/html-aam/#att-disabled
for (const _ of element.attribute("disabled")) {
yield Attribute.of("aria-disabled", "true");
// https://w3c.github.io/html-aam/#att-max-input
for (const { value } of element.attribute("max")) {
yield Attribute.of("aria-valuemax", value);
}

// https://w3c.github.io/html-aam/#att-placeholder
for (const { value } of element.attribute("placeholder")) {
yield Attribute.of("aria-placeholder", value);
// https://w3c.github.io/html-aam/#att-min-input
for (const { value } of element.attribute("min")) {
yield Attribute.of("aria-valuemin", value);
}

// https://w3c.github.io/html-aam/#att-value-input
// but https://github.com/w3c/html-aam/issues/314
for (const { value } of element.attribute("value")) {
yield Attribute.of("aria-valuenow", value);
}
},
(element, device, state) => {
Expand Down

0 comments on commit d719758

Please sign in to comment.