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
Adds tab function to docs and typings #184
Conversation
Codecov Report
@@ Coverage Diff @@
## master #184 +/- ##
======================================
Coverage 97.1% 97.1%
======================================
Files 1 1
Lines 138 138
Branches 35 35
======================================
Hits 134 134
Misses 4 4 Continue to review full report at Codecov.
|
typings/index.d.ts
Outdated
@@ -15,6 +15,7 @@ declare const userEvent: { | |||
text: string, | |||
userOpts?: IUserOptions | |||
) => Promise<void>; | |||
tab: (userOpts?: { shift: boolean }) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is no longer up to date. Could you add focusTrap
to it?
better yet, define an interface and add defaults to the options (edit: can't have defaults in interface, oops)
interface TabUserOptions {
shift?: boolean;
focusTrap?: Document;
}
declare const userEvent: {
...
tab: (userOpts?: TabUserOptions) => void;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the type of focusTrap
be TargetElement
which is defined as type TargetElement = Element | Window;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe it needs to be Document | Element
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at lib.dom.d.ts
querySelectorAll
is defined in ParentNode
which Document
and Element
both extend, so Document | Element
seems like the correct choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you happy with the current state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, then I'm going to merge it
🎉 This PR is included in version 8.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Just a simple patch to add the tab function to docs and typings.