Skip to content

Commit 6887707

Browse files
VanAndersondgreif
andauthored
data-test-id can be used with OverlayProps (#1275)
Co-authored-by: Dusty Greif <[email protected]>
1 parent 48443b7 commit 6887707

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.changeset/cool-rocks-drive.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/components": patch
3+
---
4+
5+
data props can be used in overlayProps.

src/Overlay.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export type OverlayProps = {
6565
onClickOutside: (e: TouchOrMouseEvent) => void
6666
onEscape: (e: KeyboardEvent) => void
6767
visibility?: 'visible' | 'hidden'
68+
[additionalKey: string]: unknown
6869
} & Omit<ComponentProps<typeof StyledOverlay>, 'visibility' | keyof SystemPositionProps>
6970

7071
/**

src/stories/ActionMenu.stories.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export function SimpleListStory(): JSX.Element {
9797
onAction={onAction}
9898
anchorContent="Menu"
9999
overlayProps={{
100+
'data-test-id': 'some_test_id',
100101
onMouseDown: (e: React.MouseEvent) =>
101102
// eslint-disable-next-line no-console
102103
console.log('onMouseDown in the internal Overlay can be useful for controlling event interactions', e)

0 commit comments

Comments
 (0)