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

Ignore invisible elements matching step target query #440

Closed
wants to merge 1 commit into from

Conversation

nuthinking
Copy link

If the web page has more items matching the step's query, now the invisible ones will be ignored.

See similar PR on React-Floater

@@ -134,11 +134,17 @@ export function getScrollTo(element: HTMLElement, offset: number): number {
* @returns {HTMLElement|undefined}
*/
export function getElement(element: string | HTMLElement): ?HTMLElement {
if (typeof element !== 'string') {
if (typeof element !== 'string' || !element) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If !element returns element? 😣

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true the original code returns null if element is undefined.

@gilbarbara
Copy link
Owner

I'm closing this in favor of using better selectors

@gilbarbara gilbarbara closed this Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants