From 7bb5fb7459a587ceed6b3b9229d9c74814f0757b Mon Sep 17 00:00:00 2001 From: Darick Carpenter Date: Sun, 24 May 2020 12:05:23 -0600 Subject: [PATCH 1/2] Added BindEvent to MatInputText to allow @bind:event="oninput". --- .../Demo/DemoMatTextField.razor | 49 +++++++++++++++++++ .../MatTextField/BaseMatInputTextComponent.cs | 3 ++ .../MatTextField/MatInputTextComponent.razor | 4 +- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/MatBlazor.Demo/Demo/DemoMatTextField.razor b/src/MatBlazor.Demo/Demo/DemoMatTextField.razor index bdccb56a..66c7f626 100644 --- a/src/MatBlazor.Demo/Demo/DemoMatTextField.razor +++ b/src/MatBlazor.Demo/Demo/DemoMatTextField.razor @@ -1245,6 +1245,55 @@ bool? boolNullValue; } + ")> + + + + +
Bind Event
+ + + + + +

+ + Value: @MyString11 +

+ +

+ + Value: @MyString12 +

+ + @code + { + public string MyString11 { get; set; } + public string MyString12 {get;set;} + } + +
+ + + + Value: @MyString11 +

+ +

+ + Value: @MyString12 +

+ + @code + { + + public string MyString11 {get;set;} + public string MyString11 {get;set;} + } + ")>
\ No newline at end of file diff --git a/src/MatBlazor/Components/MatTextField/BaseMatInputTextComponent.cs b/src/MatBlazor/Components/MatTextField/BaseMatInputTextComponent.cs index 1c3b936d..c1d9f892 100644 --- a/src/MatBlazor/Components/MatTextField/BaseMatInputTextComponent.cs +++ b/src/MatBlazor/Components/MatTextField/BaseMatInputTextComponent.cs @@ -94,6 +94,9 @@ protected virtual bool InputTextReadOnly() [Parameter] public string Type { get; set; } = "text"; + [Parameter] + public string BindEvent { get; set; } = "onchange"; + protected virtual EventCallback OnKeyDownEvent() { diff --git a/src/MatBlazor/Components/MatTextField/MatInputTextComponent.razor b/src/MatBlazor/Components/MatTextField/MatInputTextComponent.razor index b33a3199..74711c2c 100644 --- a/src/MatBlazor/Components/MatTextField/MatInputTextComponent.razor +++ b/src/MatBlazor/Components/MatTextField/MatInputTextComponent.razor @@ -16,11 +16,11 @@ @if (TextArea) { -