File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " bits-ui " : patch
3
+ ---
4
+
5
+ improve(ContextMenu): allow users to override ` pointer-events ` style on ` ContextMenu.Trigger `
Original file line number Diff line number Diff line change 24
24
});
25
25
26
26
const mergedProps = $derived (
27
- mergeProps (restProps , triggerState .props , { style: { pointerEvents: " auto" } })
27
+ mergeProps (
28
+ restProps ,
29
+ triggerState .props ,
30
+ { style: { pointerEvents: " auto" } },
31
+ {
32
+ style: restProps .style ,
33
+ }
34
+ )
28
35
);
29
36
</script >
30
37
Original file line number Diff line number Diff line change 11
11
portalProps? : Omit <ContextMenu .PortalProps , " children" | " child" >;
12
12
subTriggerProps? : Omit <ContextMenu .SubTriggerProps , " children" | " child" >;
13
13
checkboxGroupProps? : Omit <ContextMenu .CheckboxGroupProps , " children" | " child" | " value" >;
14
+ triggerProps? : Omit <ContextMenu .TriggerProps , " children" | " child" >;
14
15
openFocusOverride? : boolean ;
15
16
};
16
17
</script >
28
29
subTriggerProps = {},
29
30
checkboxGroupProps = {},
30
31
openFocusOverride = false ,
32
+ triggerProps = {},
31
33
... restProps
32
34
}: ContextMenuTestProps = $props ();
33
35
</script >
41
43
class =" h-[500px] w-[500px]"
42
44
aria-expanded ={undefined }
43
45
aria-controls ={undefined }
46
+ {...triggerProps }
44
47
>
45
48
open
46
49
</ContextMenu .Trigger >
Original file line number Diff line number Diff line change @@ -469,3 +469,12 @@ it("should open nested context menus", async () => {
469
469
await expectExists ( page . getByTestId ( "nested-content" ) ) ;
470
470
await expectExists ( page . getByTestId ( "content" ) ) ;
471
471
} ) ;
472
+
473
+ it ( "should allow overriding the pointer events style" , async ( ) => {
474
+ setup ( { triggerProps : { style : { pointerEvents : undefined } } } ) ;
475
+ const trigger = page . getByTestId ( "trigger" ) ;
476
+ await trigger . click ( { button : "right" } ) ;
477
+ await expectExists ( page . getByTestId ( "content" ) ) ;
478
+ await trigger . click ( { button : "right" , force : true } ) ;
479
+ await expectNotExists ( page . getByTestId ( "content" ) ) ;
480
+ } ) ;
You can’t perform that action at this time.
0 commit comments