Skip to content

Commit 6fd6741

Browse files
Merge pull request #73 from stavroskasidis/release/1.4
Release/1.4
2 parents bed184a + e08e9d9 commit 6fd6741

File tree

14 files changed

+49
-38
lines changed

14 files changed

+49
-38
lines changed

BlazorContextMenu/BlazorContextMenu.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
<LangVersion>7.3</LangVersion>
66
<IsPackable>true</IsPackable>
77
<RazorLangVersion>3.0</RazorLangVersion>
@@ -18,7 +18,7 @@
1818
<Copyright />
1919
<PackageTags>blazor blazor-component blazor-context-menu context-menu contextmenu menu blazor-menu blazorcontextmenu razor razor-components razorcomponents</PackageTags>
2020
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
21-
<Version>1.3.0</Version>
21+
<Version>1.4.0</Version>
2222
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version>
2323
<Product>Blazor.ContextMenu</Product>
2424
</PropertyGroup>
@@ -47,7 +47,7 @@
4747
</ItemGroup>
4848

4949
<ItemGroup>
50-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.0.0" />
51-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0" />
50+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
51+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
5252
</ItemGroup>
5353
</Project>

BlazorContextMenu/wwwroot/blazorContextMenu.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
}
1919

2020

21-
var openMenuId = null;
22-
var openMenuTarget = null;
2321
//Helper functions
2422
//========================================
2523
function guid() {
@@ -74,14 +72,18 @@
7472
//===========================================
7573

7674
var menuHandlerReference = null;
75+
var openMenuId = null;
76+
var openMenuTarget = null;
77+
var openingMenu = false;
7778

7879
blazorContextMenu.SetMenuHandlerReference = function (dotnetRef) {
7980
if (!menuHandlerReference) {
8081
menuHandlerReference = dotnetRef;
8182
}
8283
}
8384

84-
blazorContextMenu.ManualShow = function (menuId, x ,y) {
85+
blazorContextMenu.ManualShow = function (menuId, x, y) {
86+
openingMenu = true;
8587
var menu = document.getElementById(menuId);
8688
if (!menu) throw new Error("No context menu with id '" + menuId + "' was found");
8789
openMenuId = menuId;
@@ -90,6 +92,7 @@
9092
}
9193

9294
blazorContextMenu.OnContextMenu = function (e, menuId) {
95+
openingMenu = true;
9396
var menu = document.getElementById(menuId);
9497
if (!menu) throw new Error("No context menu with id '" + menuId + "' was found");
9598
openMenuId = menuId;
@@ -112,6 +115,8 @@
112115
if (topOverflownPixels > 0) {
113116
menu.style.top = (menu.offsetTop - menu.clientHeight) + "px";
114117
}
118+
119+
openingMenu = false;
115120
});
116121
}
117122

@@ -123,7 +128,7 @@
123128
var clickedInsideMenu = menuElement.contains(e.target);
124129
if (!clickedInsideMenu) {
125130
blazorContextMenu.Hide(openMenuId).then(function (hideSuccessful) {
126-
if (hideSuccessful) {
131+
if (hideSuccessful && !openingMenu) {
127132
openMenuId = null;
128133
openMenuTarget = null;
129134
}

DemoApp/BlazorContextMenu.DemoApp.Client/BlazorContextMenu.DemoApp.Client.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<RestoreAdditionalProjectSources>
77
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
@@ -12,10 +12,10 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Blazor.ContextMenu" Version="1.1.0-beta-498" />
16-
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19465.2" />
17-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19465.2" PrivateAssets="all" />
18-
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview9.19465.2" />
15+
<PackageReference Include="Blazor.ContextMenu" Version="1.3.0" />
16+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.1.0-preview4.19579.2" />
17+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
18+
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.1.0-preview4.19579.2" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

DemoApp/BlazorContextMenu.DemoApp.Server/BlazorContextMenu.DemoApp.Server.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<RestoreAdditionalProjectSources>
66
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
77
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
@@ -16,8 +16,8 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview9.19465.2" />
20-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.1.0-preview4.19579.2" />
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
2121
</ItemGroup>
2222

2323
<ItemGroup>

DemoApp/BlazorContextMenu.DemoApp.Shared/BlazorContextMenu.DemoApp.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
<LangVersion>7.3</LangVersion>
66
</PropertyGroup>
77

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,13 @@ public class Startup
240240
241241
## Release Notes
242242

243-
<details open="open"><summary>1.3</summary>
243+
<details open="open"><summary>1.4</summary>
244+
245+
>- Updated to 3.1 release.
246+
>- Fix for [#72](https://github.com/stavroskasidis/BlazorContextMenu/issues/72).
247+
</details>
248+
249+
<details><summary>1.3</summary>
244250

245251
>- Added menu `OnHiding` event [#68](https://github.com/stavroskasidis/BlazorContextMenu/issues/68).
246252
</details>

TestApps/BlazorContextMenu.TestAppsCommon/BlazorContextMenu.TestAppsCommon.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
<LangVersion>7.3</LangVersion>
66
<RazorLangVersion>3.0</RazorLangVersion>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Client/BlazorContextMenu.BlazorTestApp.Client.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
<LangVersion>7.3</LangVersion>
66
<RestoreAdditionalProjectSources>
77
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
@@ -14,9 +14,9 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19465.2" />
18-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19465.2" PrivateAssets="all" />
19-
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview9.19465.2" />
17+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.1.0-preview4.19579.2" />
18+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
19+
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.1.0-preview4.19579.2" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Server/BlazorContextMenu.BlazorTestApp.Server.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<LangVersion>7.3</LangVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview9.19465.2" />
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
9+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.1.0-preview4.19579.2" />
10+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

TestApps/RazorComponentsTestApp/BlazorContextMenu.RazorComponentsTestApp/BlazorContextMenu.RazorComponentsTestApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<LangVersion>7.3</LangVersion>
66
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
77
</PropertyGroup>

0 commit comments

Comments
 (0)