Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.2.1</Version>
<Version>10.2.2-beta02</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
26 changes: 14 additions & 12 deletions src/BootstrapBlazor/Components/ContextMenu/ContextMenu.razor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Data from "../../modules/data.js"
import Data from "../../modules/data.js"
import EventHandler from "../../modules/event-handler.js"
import { createPopper, computePosition } from '../../modules/floating-ui.js'
import { registerBootstrapBlazorModule } from "../../modules/utility.js"
Expand Down Expand Up @@ -36,21 +36,23 @@ export function init(id) {
}

export function show(id, event) {
const cm = Data.get(id)
setTimeout(() => {
const cm = Data.get(id)

if (cm) {
const el = cm.el
const zone = cm.zone
if (cm) {
const el = cm.el
const zone = cm.zone

const body = document.body
body.appendChild(el)
const body = document.body
body.appendChild(el)

if (cm.popper) {
cm.popper()
}
if (cm.popper) {
cm.popper()
}

cm.popper = createPopper(zone, el, () => showContextMenu(zone, el, event))
}
cm.popper = createPopper(zone, el, () => showContextMenu(zone, el, event))
}
}, 0);
}

export function dispose(id) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
Expand Down Expand Up @@ -59,7 +59,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
/// <summary>
/// 点击 ContextMenu 菜单项时触发
/// </summary>
/// <returns></returns>
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(MouseEventArgs))]
public Task OnContextMenu(MouseEventArgs args) => ContextMenuZone.OnContextMenu(args, ContextItem);

/// <summary>
Expand Down
Loading
Loading