-
Notifications
You must be signed in to change notification settings - Fork 1
elementMatches function does not work with :focus pseudo-class #15
Comments
Hey @MaksymDryha thanks for opening an issue! This one is quite interesting 🤔 I'm curious why In the mean time, you can absolutely implement that exact code on your interactor 😃 It could be a custom method on that interactor or you could create a custom interactor creator & import Lastly, we're implementing something just like you've written in an update coming to Interactor soon. We're introducing a concept of "validations" to interactor. So keep your eyes peeled for that too :) |
Hi @Robdel12 ! The example of using function elementMatches($el, selector) {
/*
imagine that $el is focused, at this moment we would have:
$el === document.activeElement -> true
but:
$el.matches(':focus') -> false
*/
if (!$el.matches) {
return $el.msMatchesSelector(selector);
} else {
return $el.matches(selector);
}
} It's nice to know, that validations are coming :) Thanks for your reply! |
@Robdel12, when can we expect to see validations introduced? It's a highly expected feature for our project. Are there at least approximate dates of the next release? |
It seems like currently there is no way to check if an element is focused. We tried to do it using by
is
helper, but theelementMatches
does not work with:focus
pseudo-class.Maybe some kind of
isFocused
getter should be added, for example, like this:The text was updated successfully, but these errors were encountered: