Skip to content

data-test-id can be used with OverlayProps #1275

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

Merged
merged 4 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cool-rocks-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/components": patch
---

data props can be used in overlayProps.
1 change: 1 addition & 0 deletions src/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export type OverlayProps = {
onClickOutside: (e: TouchOrMouseEvent) => void
onEscape: (e: KeyboardEvent) => void
visibility?: 'visible' | 'hidden'
[additionalKey: string]: unknown
} & Omit<ComponentProps<typeof StyledOverlay>, 'visibility' | keyof SystemPositionProps>

/**
Expand Down
1 change: 1 addition & 0 deletions src/stories/ActionMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export function SimpleListStory(): JSX.Element {
onAction={onAction}
anchorContent="Menu"
overlayProps={{
'data-test-id': 'some_test_id',
onMouseDown: (e: React.MouseEvent) =>
// eslint-disable-next-line no-console
console.log('onMouseDown in the internal Overlay can be useful for controlling event interactions', e)
Expand Down