From 4d4b0129230ed2da107307884bdb7f959245176a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 3 Feb 2024 17:00:16 +0800 Subject: [PATCH] feat(RibbonTab): reset ribbon-tab item min-width to 58px (#2890) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 调整 Ribbon 菜单最小宽度为 58 * refactor: 重构开发环境 JSInvoke 报错信息 --- src/BootstrapBlazor/Utils/JSModule.cs | 34 ++++++++++++++----- .../wwwroot/scss/theme/bootstrap.blazor.scss | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/BootstrapBlazor/Utils/JSModule.cs b/src/BootstrapBlazor/Utils/JSModule.cs index 49b569b2b26..c3f8d579d36 100644 --- a/src/BootstrapBlazor/Utils/JSModule.cs +++ b/src/BootstrapBlazor/Utils/JSModule.cs @@ -63,16 +63,22 @@ async ValueTask InvokeVoidAsync() { await Module.InvokeVoidAsync(identifier, cancellationToken, [.. paras]); } -#if DEBUG catch (JSException) { +#if DEBUG System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}"); throw; - } #endif + } catch (JSDisconnectedException) { } catch (OperationCanceledException) { } - catch (ObjectDisposedException) { } + catch (ObjectDisposedException) + { +#if DEBUG + System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}"); + throw; +#endif + } } } @@ -121,16 +127,22 @@ async ValueTask InvokeAsync() { ret = await Module.InvokeAsync(identifier, cancellationToken, [.. paras]); } -#if DEBUG catch (JSException) { +#if DEBUG System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}"); throw; - } #endif + } catch (JSDisconnectedException) { } catch (OperationCanceledException) { } - catch (ObjectDisposedException) { } + catch (ObjectDisposedException) + { +#if DEBUG + System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}"); + throw; +#endif + } return ret; } @@ -144,12 +156,18 @@ protected virtual async ValueTask DisposeAsyncCore(bool disposing) { if (disposing) { - // TODO: 微软的代码这里加上 await 就会线程死锁 try { await Module.DisposeAsync(); } - catch { } + catch (JSDisconnectedException) { } + catch (Exception) + { +#if DEBUG + System.Console.WriteLine($"{GetType().FullName} disposing throw exception"); + throw; +#endif + } } } diff --git a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss index d4ba4e51375..3b07d169905 100644 --- a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss +++ b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss @@ -426,7 +426,7 @@ $bb-ribbon-button-border-color: transparent; $bb-ribbon-button-radius: 3px; $bb-ribbon-button-padding: 0.25rem; $bb-ribbon-button-fontsize: 0.75rem; -$bb-ribbon-button-min-width: 56px; +$bb-ribbon-button-min-width: 58px; $bb-ribbon-group-fontsize: 11px; $bb-ribbon-group-color: #adb5bd; $bb-ribbon-group-margin-top: .25rem;