File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export function useDropdownMenu(options = {}) {
40
40
else if ( drop === 'left' ) placement = alignEnd ? 'left-end' : 'left-start' ;
41
41
42
42
const popper = usePopper ( toggleElement , menuElement , {
43
- ... popperConfig ,
43
+ popperConfig,
44
44
placement,
45
45
enabled : ! ! ( shouldUsePopper && show ) ,
46
46
eventsEnabled : ! ! show ,
Original file line number Diff line number Diff line change @@ -22,22 +22,20 @@ const initialArrowStyles = {};
22
22
* @param {String } options.placement The popper element placement relative to the reference element
23
23
* @param {Boolean } options.positionFixed use fixed positioning
24
24
* @param {Boolean } options.eventsEnabled have Popper listen on window resize events to reposition the element
25
- * @param {Function } options.onCreate called when the popper is created
26
- * @param {Function } options.onUpdate called when the popper is updated
25
+ * @param {Object } options.popperConfig Popper.js options (except modifiers, placement, positionFixed)
27
26
*/
28
27
export default function usePopper (
29
28
referenceElement ,
30
29
popperElement ,
31
- options = { } ,
32
- ) {
33
- const {
30
+ {
34
31
enabled = true ,
35
32
placement = 'bottom' ,
36
33
positionFixed = false ,
37
34
eventsEnabled = true ,
38
35
modifiers = { } ,
39
- } = options ;
40
-
36
+ popperConfig = { } ,
37
+ } = { } ,
38
+ ) {
41
39
const popperInstanceRef = useRef ( ) ;
42
40
43
41
const hasArrow = ! ! ( modifiers . arrow && modifiers . arrow . element ) ;
@@ -85,7 +83,7 @@ export default function usePopper(
85
83
} ;
86
84
87
85
popperInstanceRef . current = new PopperJS ( referenceElement , popperElement , {
88
- ...options ,
86
+ ...popperConfig ,
89
87
placement,
90
88
positionFixed,
91
89
modifiers : {
You can’t perform that action at this time.
0 commit comments