Editor cancel editing on OnInput event

I have the next editor with embedded mask component with on input check up for phone format validity:

                                                <SfInPlaceEditor TValue="string" Value="@(ProfileUser.PhoneNumber.MaskedPhoneFromFullNumber(PhoneMask))" CssClass="w-80" EnableEditMode="EnableEditModePhoneNumber"

                                                             EmptyText="-" Mode="RenderMode.Inline" Type="Syncfusion.Blazor.InPlaceEditor.InputType.Text" ActionOnBlur="ActionBlur.Cancel">

                                                    <InPlaceEditorEvents TValue="string" OnActionBegin="@OnPhoneNumberChanging" />

                                                    <EditorComponent>

                                                        <SfMaskedTextBox ID="Phone" Placeholder="@(StringLocalizer["Enter the phone number..."])" ShowClearButton="true"

                                                                     @bind-Value="@ShortPhoneNumber" Mask="@PhoneMask" CssClass="@(PhoneValidationMessage != null ? "e-error" : string.Empty)"

                                                                     OnInput="@OnPhoneNumberInput" OnBlur="@OnPhoneNumberBlur"

                                                                     @onkeydown="@(args => { if ((args.Key == "Backspace" || args.Key == "Delete") &&

                                                                     string.IsNullOrEmpty(ShortPhoneNumber) && PhoneMask != Consts.PhoneMaskBase)

                                                                     { PhoneMask = Consts.PhoneMaskBase; MaskChanged = true; }})" />

                                                        @if (PhoneValidationMessage != null)

                                                        {

                                                            <div class="validation-message ">@PhoneValidationMessage</div>

                                                        }

                                                    </EditorComponent>

                                                </SfInPlaceEditor>


Before todays update everything worked, but after update in-line editor stops editing after each key press (where the format validity should be checked only).



3 Replies

BS Buvana Sathasivam Syncfusion Team February 9, 2022 02:36 PM UTC

Hi Stanislav, 
 
Greetings from Syncfusion support. 
 
We were unable to reproduce your reported problem based on your shared code. The OnInput event is not exposed inside the SfMaskedTextBox component. Please see below the documentation for available events support on the SfMaskedTextBox component. 
 
 
We have provided built-in support for the masked textbox in the in-place editor when setting the Type property as "Mask". 

<SfInPlaceEditor Type="Syncfusion.Blazor.InPlaceEditor.InputType.Mask"> 
   <EditorComponent> 
       <SfMaskedTextBox ……  <SfMaskedTextBox> 
   </EditorComponent> 
</SfInPlaceEditor> 
 
 
 
Based on your shared code, we have created the below sample. 
 
Could you please share the below information? 
  • Share your previously and current used Nuget version with us.
  • Reproduce your issue on the above shared sample or else share your full page code to reproduce your issue.
  • Please share the video with your issue so we can understand your problem.
 
Regards, 
Buvana S 



SG Stanislav Gordenko February 10, 2022 01:09 PM UTC

I found an answer. An edit mode was bound to variable and was not turned on when the user started to edit.


BeginEdit="@(() => EnableEditModePhoneNumber = true)" solved the troub



BS Buvana Sathasivam Syncfusion Team February 11, 2022 11:51 AM UTC

Hi Stanislav, 

We are happy to hear your problem has been solved.  Please let us know if you have any further queries.   

Regards, 
Buvana S 



Loader.
Up arrow icon