Fix accessibility sim regression when setting pin ARIA text. Fixes pxt#2894 (#533)

This commit is contained in:
Sam El-Husseini 2017-09-10 22:38:01 -07:00 committed by GitHub
parent e8ed746338
commit 4459445b8c
2 changed files with 4 additions and 3 deletions

View File

@ -45,6 +45,7 @@
"Math.pow|param|y": "The exponent value of the expression.",
"Math.random": "Return a pseudorandom number between 0 and `limit`.",
"Math.randomBoolean": "Generates a `true` or `false` value randomly, just like flipping a coin.",
"Math.random|param|limit": "the upper bound of the number generated, eg: 4.",
"Math.sign": "Returns the sign of the x, indicating whether x is positive, negative or zero.",
"Math.sign|param|x": "The numeric expression to test",
"Math.sqrt": "Return the square root of a number.",

View File

@ -477,10 +477,10 @@ namespace pxsim.visuals {
accessibility.makeFocusable(this.pins[index]);
accessibility.setAria(this.pins[index], "slider", this.pins[index].firstChild.textContent);
this.pins[index].setAttribute("aria-valuemin", "0");
this.pins[index].setAttribute("aria-valuemax", "1023");
this.pins[index].setAttribute("aria-valuemax", pin.mode & PinFlags.Analog ? "1023" : "100");
this.pins[index].setAttribute("aria-orientation", "vertical");
this.pins[index].setAttribute("aria-valuenow", text.textContent);
accessibility.setLiveContent(text.textContent);
this.pins[index].setAttribute("aria-valuenow", text ? text.textContent : v);
accessibility.setLiveContent(text ? text.textContent : v);
}
}