Can't select SVG element with tab
or shift-tab
#6262
Labels
AREA: client
FREQUENCY: level 1
SYSTEM: automations
TYPE: bug
The described behavior is considered as wrong (bug).
Can't select SVG element with
tab
orshift-tab
in Chrome.use case:
using
pressKey('tab')
orpressKey('shift+tab')
should be able to navigate svg elements with tabIndex set, like<svg tabindex="0" role="button">...</svg>
actual behavior:
SVG element is not selected, next selectable element is selected instead. When navigating manually in the browser, everything works properly.
what works wrong:
Problem is on this line:
testcafe/src/client/core/utils/dom.js
Line 233 in d48db36
Not sure if it's Chrome specific, or it works the same in other browsers as well, but the only correct version for SVG elements is
el.getAttribute('tabindex');
for other HTML elements it can beel.getAttribute('tabindex');
,el.getAttribute('tabIndex');
or evenel.getAttribute('TABINDEX');
, while for svg nothing works butel.getAttribute('tabindex');
only.possible solution:
replace
el.getAttribute('tabIndex');
byel.getAttribute('tabindex');
, or in case if camelcased version is required because of some other browser-specific things, it can be changed toel.getAttribute('tabIndex') || el.getAttribute('tabindex')
;The text was updated successfully, but these errors were encountered: