File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @igloo-ui/action-menu " : minor
3
+ " @igloo-ui/dropdown " : minor
4
+ ---
5
+
6
+ Added dropdownOffset to Actionmenu and Dropdown components. Also added dropdownClassName to ActionMenu.
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ export interface ActionMenuProps extends React.ComponentProps<"div"> {
34
34
/** Whether or not the menu should use ReactPortal
35
35
* to append to the body */
36
36
disablePortal ?: boolean ;
37
+ /** Add a specific class to the dropdown */
38
+ dropdownClassName ?: string ;
39
+ /** Offset of the dropdown */
40
+ dropdownOffset ?: number ;
37
41
/** Whether or not the action menu should be open by default */
38
42
isOpen ?: boolean ;
39
43
/** Callback when the action menu is closed and animations are done */
@@ -57,6 +61,8 @@ const ActionMenu: React.FunctionComponent<ActionMenuProps> = ({
57
61
className,
58
62
dataTest,
59
63
disablePortal = false ,
64
+ dropdownClassName,
65
+ dropdownOffset,
60
66
isOpen = false ,
61
67
onAfterMenuClose,
62
68
onMenuClose,
@@ -244,7 +250,8 @@ const ActionMenu: React.FunctionComponent<ActionMenuProps> = ({
244
250
/>
245
251
}
246
252
isOpen = { showMenu }
247
- className = "ids-action-menu__dropdown"
253
+ className = { cx ( "ids-action-menu__dropdown" , dropdownClassName ) }
254
+ dropdownOffset = { dropdownOffset }
248
255
position = { position }
249
256
onClose = { ( ) => toggleMenu ( false ) }
250
257
onAfterClose = { onAfterMenuClose }
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ export interface DropdownProps
70
70
/** The threshold in pixels from the bottom of the dropdown
71
71
* to trigger the onScrollEnd callback */
72
72
scrollEndThreshold ?: number ;
73
+ /** The offset of the dropdown from the reference */
74
+ dropdownOffset ?: number ;
73
75
}
74
76
75
77
const Dropdown : React . FunctionComponent < DropdownProps > = React . forwardRef (
@@ -93,6 +95,7 @@ const Dropdown: React.FunctionComponent<DropdownProps> = React.forwardRef(
93
95
footer,
94
96
onScrollEnd,
95
97
scrollEndThreshold = 30 ,
98
+ dropdownOffset = 4 ,
96
99
...rest
97
100
} : DropdownProps ,
98
101
ref : React . ForwardedRef < HTMLDivElement >
@@ -147,7 +150,7 @@ const Dropdown: React.FunctionComponent<DropdownProps> = React.forwardRef(
147
150
return cleanup ;
148
151
} ,
149
152
middleware : [
150
- offset ( 1 ) ,
153
+ offset ( dropdownOffset ) ,
151
154
flip ( { padding : 10 } ) ,
152
155
fuiSize ( {
153
156
apply ( { rects, elements, availableHeight } ) {
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ export interface DropdownProps
54
54
/** The threshold in pixels from the bottom of the dropdown
55
55
* to trigger the onScrollEnd callback */
56
56
scrollEndThreshold ?: number ;
57
+ /** The offset of the dropdown from the reference */
58
+ dropdownOffset ?: number ;
57
59
}
58
60
59
61
const MockDropdown : React . FunctionComponent < DropdownProps > = ( {
@@ -75,6 +77,7 @@ const MockDropdown: React.FunctionComponent<DropdownProps> = ({
75
77
footer,
76
78
onScrollEnd,
77
79
scrollEndThreshold = 30 ,
80
+ dropdownOffset = 4 ,
78
81
...rest
79
82
} : DropdownProps ) => {
80
83
const { x, y, refs } = {
You can’t perform that action at this time.
0 commit comments