Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't select SVG element with tab or shift-tab #6262

Closed
PinkaminaDianePie opened this issue May 27, 2021 · 1 comment
Closed

Can't select SVG element with tab or shift-tab #6262

PinkaminaDianePie opened this issue May 27, 2021 · 1 comment
Labels
AREA: client FREQUENCY: level 1 SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug).

Comments

@PinkaminaDianePie
Copy link

Can't select SVG element with tab or shift-tab in Chrome.

use case:

using pressKey('tab') or pressKey('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:

let tabIndex = el.getAttribute('tabIndex');

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 be el.getAttribute('tabindex');, el.getAttribute('tabIndex'); or even el.getAttribute('TABINDEX');, while for svg nothing works but el.getAttribute('tabindex'); only.

possible solution:

replace el.getAttribute('tabIndex'); by el.getAttribute('tabindex');, or in case if camelcased version is required because of some other browser-specific things, it can be changed to el.getAttribute('tabIndex') || el.getAttribute('tabindex');

  • browser name and version: Chrome 90
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 27, 2021
@AlexKamaev
Copy link
Contributor

I reproduced the issue. Thank you for looking into this and offering a solution. I confirm that your code modification makes TestCafe work correctly. However, we need time to research it in detail.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label May 31, 2021
@AlexKamaev AlexKamaev added FREQUENCY: level 1 TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: automations AREA: client labels May 31, 2021
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: client FREQUENCY: level 1 SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants