From 863b3e9263975a6656f54dba3b228f007660f86e Mon Sep 17 00:00:00 2001 From: Marcus Kertesz Date: Tue, 15 Oct 2024 09:50:13 -0700 Subject: [PATCH 1/2] Bump System.Text.Json to 8.0.5 Security vulnerability is causing error on builds --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2ef2fb3..f7e5cab 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -122,7 +122,7 @@ - + From de91340c62072b06711d2a02ab88a78630d50bf3 Mon Sep 17 00:00:00 2001 From: Marcus Kertesz Date: Tue, 15 Oct 2024 09:55:16 -0700 Subject: [PATCH 2/2] PureInput Hotfix I'm assuming InnerValue was to safely control the component's bound value without exposing the parent value. Trouble is, we never properly updated this. Rather than fix that, I opted to abuse the fact that we wrapped the bind in the first place, since TextValue only needs to be read-only and OnChange/OnInput pass it up the parent bind --- .../Forms/PureInput.razor.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Pure.Blazor.Components/Forms/PureInput.razor.cs b/src/Pure.Blazor.Components/Forms/PureInput.razor.cs index f7e99ee..c1c3dd0 100644 --- a/src/Pure.Blazor.Components/Forms/PureInput.razor.cs +++ b/src/Pure.Blazor.Components/Forms/PureInput.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Web; +using Microsoft.Extensions.Logging; using Pure.Blazor.Components.Forms.Validators; using Pure.Blazor.Components.Primitives; @@ -15,12 +16,21 @@ public partial class PureInput private string defaultBorder = "border-gray-200"; private string errorBorder = "border-red-600"; private string? errorMessage; - private object? innerValue; private string? TextValue { - get { return innerValue?.ToString(); } - set { innerValue = value; } + get + { + return Value?.ToString(); + } + set + { + // We abuse the fact that we bind Text-Value instead of Value directly. + // updates are sent via OnValue up to the actual user inputted bind + // Since we never update 'TextValue', only the getter is required to be implemented + // The compiler still requires a setter + Log.LogDebug("TextValue's `set` is not implemented; please use Value's `set`"); + } } // the suffix needs different margins depending on labels and helper text @@ -141,7 +151,6 @@ public void Validate(object? val) protected override void OnInitialized() { - innerValue = Value ?? default; if (Required == true) {