Failed to execute 'querySelectorAll' (not a valid selector) error when tabbing out of calendar component #10859
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Current Queue Time for Review
Without PRO Support: ~8-12 weeks.
With PRO Support: 1 hour
I'm submitting a ... (check one with "x")
We're using Selenium to test our front-end that has been written in Angular / PrimeNG. Recently, we've updated to PrimeNG 12.2.2 and since then we're experiencing problems with some of our selenium tests.
Specifically, those failing tests try to select a p-calendar, fill in a date and press
tab
to navigate to the next focusable element. When thetab
has been pressed, nothing happens but the following error is logged:with the following stacktrace:
Unfortunately, I can't find a scenario to reproduce it manually, we've only seen these issues in selenium tests using chromedriver-87.0.4280.88.
Because we can't reproduce this issue manually, we've investigated the code and the changes that have been made between 12.2.1 (the version where we don't experience these issues) and 12.2.2. We've found the following change which I think is the cause of those issues:
1859368#diff-f06db4f0a39f51657e3d30d961041b622a933495cd2ac8d6f82e7078999ddef7
From what I understand is that this function (getFocusableElements) is invoked when an onInputKeydown occured and tries to find all focusable elements to find out which element should be set the focus on. When looking at the selectors and the change in the mentioned commit, I think the part
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]:not(.p-disabled))
is not correct. To me, it looks that the parentheses around:not([hidden]:not(.p-disabled))
are wrong and should be:not([hidden]):not(.p-disabled)
.Currently, it selects elements which has class
p-disabled
and has not the attributehidden
. I think the function shouldn't select elements with classp-disabled
or attributehidden
.I can't proof if and why this selector will fail our tests, but I can imagine that older chromedrivers can't handle a
:not
in a:not
. But to me, the current selector looks at least functionally wrong.The text was updated successfully, but these errors were encountered: