File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 7
7
export let item: MenuDropDownButton
8
8
export let className: string | undefined = undefined
9
9
export let onCloseContextMenu: () => void
10
+
11
+ $ : items = item .items .map (item => ({
12
+ ... item ,
13
+ onClick : (event : MouseEvent ) => {
14
+ onCloseContextMenu ()
15
+ item .onClick (event )
16
+ }
17
+ }))
10
18
</script >
11
19
12
- <DropdownButton width ={item .width } items ={item . items }>
20
+ <DropdownButton width ={item .width } items ={items }>
13
21
<button
14
22
class ={classnames (' jse-context-menu-button' , className , item .main .className )}
15
23
type =" button"
Original file line number Diff line number Diff line change 381
381
382
382
function onRenderContextMenu(items : ContextMenuItem [], context : RenderMenuContext ) {
383
383
console .log (' onRenderContextMenu' , items , context )
384
- return items // This return is equivalent to onRenderContextMenu is undefined
384
+ return items
385
385
}
386
386
387
387
function openInWindow() {
You can’t perform that action at this time.
0 commit comments