diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 220a5e37..c1adf164 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -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.", diff --git a/sim/visuals/microbit.ts b/sim/visuals/microbit.ts index 8dd66fe0..3cd4c9b5 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -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); } }