Instead of using className which may be of type SVGAnimatedString if the element is an SVG element, use getAttribute('class'). As that function can return null if the class attribute is not defined, use optional chaining to avoid a new error...
Uses the same pattern in hardwareEventKeyboard.ts, although I suspect the problem may never arise there.
I audited the uses of className in our KeymanWeb source and found only these three instances which may be problematic. I have not searched elsewhere.
Fixes #11364.
Instead of using
className
which may be of typeSVGAnimatedString
if the element is an SVG element, usegetAttribute('class')
. As that function can returnnull
if the class attribute is not defined, use optional chaining to avoid a new error...Uses the same pattern in hardwareEventKeyboard.ts, although I suspect the problem may never arise there.
I audited the uses of className in our KeymanWeb source and found only these three instances which may be problematic. I have not searched elsewhere.
@keymanapp-test-bot skip