Skip to content

Commit

Permalink
data-test-id can be used with OverlayProps (#1275)
Browse files Browse the repository at this point in the history
Co-authored-by: Dusty Greif <dgreif@users.noreply.github.com>
  • Loading branch information
VanAnderson and dgreif committed Jun 9, 2021
1 parent 48443b7 commit 6887707
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
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

1 comment on commit 6887707

@vercel
Copy link

@vercel vercel bot commented on 6887707 Jun 9, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.