paper-icon-button icon indicating copy to clipboard operation
paper-icon-button copied to clipboard

Setting alt property to undefined breaks link to aria-label

Open Tronil opened this issue 6 years ago • 0 comments

Description

If you at any time set the paper-icon-button alt property to undefined (which is easily done when using bindings), it stops updating the aria-label attribute and it gets stuck with the value "undefined".

The problem is in the guard that checks the old value against the current value of the aria-label attribute (the oldValue == label comparison) - it doesn't handle non-string values correctly. oldValue should be converted to a string before comparing.

Expected outcome

Changing the alt property should update the aria-label attribute.

Actual outcome

aria-label will keep having "undefined" as value

Steps to reproduce

  1. Put a paper-icon-button element in the page.
  2. Set the alt property to undefined
  3. Set the alt property to "Some text"

Tronil avatar Mar 08 '19 09:03 Tronil