Fix accessibility sim regression when setting pin ARIA text. Fixes pxt#2894 (#533)
This commit is contained in:
		@@ -45,6 +45,7 @@
 | 
				
			|||||||
  "Math.pow|param|y": "The exponent value of the expression.",
 | 
					  "Math.pow|param|y": "The exponent value of the expression.",
 | 
				
			||||||
  "Math.random": "Return a pseudorandom number between 0 and `limit`.",
 | 
					  "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.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": "Returns the sign of the x, indicating whether x is positive, negative or zero.",
 | 
				
			||||||
  "Math.sign|param|x": "The numeric expression to test",
 | 
					  "Math.sign|param|x": "The numeric expression to test",
 | 
				
			||||||
  "Math.sqrt": "Return the square root of a number.",
 | 
					  "Math.sqrt": "Return the square root of a number.",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -477,10 +477,10 @@ namespace pxsim.visuals {
 | 
				
			|||||||
                accessibility.makeFocusable(this.pins[index]);
 | 
					                accessibility.makeFocusable(this.pins[index]);
 | 
				
			||||||
                accessibility.setAria(this.pins[index], "slider", this.pins[index].firstChild.textContent);
 | 
					                accessibility.setAria(this.pins[index], "slider", this.pins[index].firstChild.textContent);
 | 
				
			||||||
                this.pins[index].setAttribute("aria-valuemin", "0");
 | 
					                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-orientation", "vertical");
 | 
				
			||||||
                this.pins[index].setAttribute("aria-valuenow", text.textContent);
 | 
					                this.pins[index].setAttribute("aria-valuenow", text ? text.textContent : v);
 | 
				
			||||||
                accessibility.setLiveContent(text.textContent);
 | 
					                accessibility.setLiveContent(text ? text.textContent : v);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user