In-place Editor with Numeric type works inconsistent at different place

Hi team,

I prepared a sample project to show the confusing case, a mess, actually. I put same In-place Editor with Numeric type component at Index.razor (I call that E1 below) and InplaceEditorFeatures (E2 below), you can find them easily, the ridiculous things are:

1. E1's clear button sets value to -1, and E2 makes it empty.

2. both of their "min" limitation dosen't work.

3. both of their decimals model dosen't work.

4. when set a breakpoint, you can find the cleared value not null but "0" for E2,  but the bind variable is int? type, not to mention the weird "-1" for E1.

5. format set to "0" and activated validateDecimalOnType in the model dosen't work while typing in, the decimal point still can be input.

What happen to the two identical components? A lot of strange things happened after I upgraded to v18.2.0.44, and I promise all that worked fine in previous versions.

Please help me to figure that out, thanks.

Attachment: SyncfusionBlazorModel_686cb82.rar

14 Replies 1 reply marked as answer

IS Indrajith Srinivasan Syncfusion Team July 10, 2020 04:06 PM UTC

Hi Brian,

Greetings from Syncfusion support,

We have validated your reported queries.
 
 
Query 1: “1. E1's clear button sets value to -1, and E2 makes it empty.  when set a breakpoint, you can find the cleared value not null but "0" for E2,  but the bind variable is int? type, not to mention the weird "-1" for E1.” 
 
We have validated on the reported query and have considered “When clearing the numeric value, default value is not set properly when Inplace-editor placed inside table” as a bug from our end and logged the report for the same, and the fix will be included with our weekly patch release, which is scheduled on 21st of July. 

You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/15978/
 
 
Query 2: “Both of their "min" limitation doesn't work. Both of their decimals model doesn't work.” 
 
When using the NumericTextBox Model as object type the corresponding properties are not binded properly for the Model. For decimal need to set the Format as “n2” 0r “n3” based on the number of decimal places needed. As a workaround, we suggest you to define you the Model like below for the DropDownList. We will also include the existing working behavior with Inplace-editor Model binding within our next weekly patch release scheduled on 14th July. Until then you can use the below way for binding the Model. 

Feedback link:
https://www.syncfusion.com/feedback/15979/

 
 
@using Syncfusion.Blazor.InPlaceEditor 
@using Syncfusion.Blazor.Inputs 
@using Syncfusion.Blazor.Calendars 
@using Newtonsoft.Json 
 
<SfInPlaceEditor Mode="RenderMode.Inline" Type="Syncfusion.Blazor.InPlaceEditor.InputType.Numeric" ShowButtons="false" @bind-Value="@NumericValue1" Model="@NumericModel"></SfInPlaceEditor>       

 
@code { 
    private int? NumericValue1 = 20; 
  private NumericModelClass NumericModel = new NumericModelClass 
    { 
        Placeholder = "Currency format", 
        Format = "n2", 
        ValidateDecimalOnType = true, 
        Max = 25, 
        Min = 0, 
        Decimals = 2, 
        ShowClearButton = true 
 
    }; 
    public class NumericModelClass 
    { 
        [JsonProperty("placeHolder")] 
        public string Placeholder { get; set; } 
        [JsonProperty("format")] 
        public string Format { get; set; } 
        [JsonProperty("validateDecimalOnType")] 
        public bool ValidateDecimalOnType { get; set; } 
        [JsonProperty("max")] 
        public int? Max { get; set; } 
        [JsonProperty("min")] 
        public int? Min { get; set; } 
        [JsonProperty("decimals")] 
        public int? Decimals { get; set; } 
        [JsonProperty("showClearButton")] 
        public bool ShowClearButton { get; set; } 
    } 
} 
 
 
Please let us know if you face any difficulties,

Regards,
 
Indrajith 


Marked as answer

IS Indrajith Srinivasan Syncfusion Team July 14, 2020 02:07 PM UTC

Hi Brian,

 
Thanks for your patience, 
 
Query 2: “Both of their "min" limitation doesn't work. Both of their decimals model doesn't work.”  

We have resolved the issues with Inplace-editor Model bindings and the fix is now available with the Nuget package version 18.2.45. Below is the list of code blocks for Inplace-editor Models. We will also include the same in our documentation.
 

Changes done:
 
 
Model 
Before  
After 
DropDownList 
public SfDropDownList<string, string> DropModel = new SfDropDownList<string, string>() 
    { 
        Placeholder = "Android", 
        DataSource = new string[] { "Android", "JavaScript", "jQuery", "TypeScript", "Angular", "React", "Vue", "Ionic" } 
    }; 
public DropDownListModel<string> DropModel = new DropDownListModel<string>() 
    { 
        Placeholder = "Android", 
        DataSource = new string[] { "Android", "JavaScript", "jQuery", "TypeScript", "Angular", "React", "Vue", "Ionic" } 
    }; 
DateTime 
public TimePickerModel TimeModel = new TimePickerModel() 
    { 
        Placeholder = "Select date" 
    }; 
public TimePickerModel<string> TimeModel = new TimePickerModel<string>() 
    { 
        Placeholder = "Select date" 
    }; 
 
 
 
@using Syncfusion.Blazor.InPlaceEditor 
@using Syncfusion.Blazor.RichTextEditor 
 
<h3> Built-in Controls </h3> 
<table class="table-section"> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> DatePicker </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Date" Value="@DateValue" Model="@DateModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> DateTimePicker </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.DateTime" Value="@DateTimeValue" Model="@DateTimeModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> DropDownList </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.DropDownList" Value="@DropValue" Model="@DropModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> MaskedTextBox </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Mask" Value="@MaskValue" Model="@MaskedModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> NumericTextBox </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Numeric" Value="@NumericValue" Model="@NumericModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> TextBox </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Text" Value="@TextValue" SubmitOnEnter="true" Model="@TextModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
</table> 
<h3> Injectable Controls </h3> 
<table class="table-section"> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> AutoComplete </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.AutoComplete" Value="@AutocompValue" SubmitOnEnter="true" Model="@AutocompModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> ColorPicker </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Color" Value="@ColorValue" SubmitOnEnter="true"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> ComboBox </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.ComboBox" Value="@ComboBoxValue" SubmitOnEnter="true" Model="@ComboBoxModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> DateRangePicker </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.DateRange" Value="@DateRangeValue" SubmitOnEnter="true" Model="@DateRangeModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> MultiSelect </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.MultiSelect" Value="@MultiValue" SubmitOnEnter="true" Model="@MultiModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> RTE </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.RTE" Value="@RteValue" SubmitOnEnter="true" Model="@RteModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> Slider </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Slider" Value="@SliderValue" SubmitOnEnter="true"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
    <tr> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6 control-title"> TimePicker </td> 
        <td class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> 
            <SfInPlaceEditor Mode="RenderMode.Inline" Type="InputType.Time" Value="@TimeValue" SubmitOnEnter="true" Model="@TimeModel"> 
            </SfInPlaceEditor> 
        </td> 
    </tr> 
</table> 
 
<style> 
 
    body { 
        padding: 20px 0 
    } 
 
    .control-title { 
        font-weight: 600; 
        padding-right: 20px; 
    } 
 
    .control-title { 
        width: 50%; 
    } 
 
    td { 
        height: 80px; 
    } 
 
    tr td:first-child { 
        text-align: right; 
    } 
 
    tr td:last-child { 
        text-align: left; 
    } 
 
    .table-section { 
        margin: 0 auto; 
    } 
 
    h3 { 
        text-align: center; 
    } 
</style> 
 
@code { 
    public DateTime DateValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); 
    public DateTime DateTimeValue { get; set; } = DateTime.Now; 
    public DateTime[] DateRangeValue { get; set; } = new DateTime[] { DateTime.Now, DateTime.Now.AddDays(20) }; 
    public DateTime TimeValue { get; set; } = DateTime.Now; 
 
    public string MaskValue = "123-345-678"; 
    public string NumericValue = "10"; 
    public string TextValue = "Andrew"; 
    public string DropValue = "Android"; 
    public string AutocompValue = "Android"; 
    public string ColorValue = "#81aefd"; 
    public string ComboBoxValue = "Android"; 
    public string[] MultiValue = new string[] { "Android" }; 
    public string RteValue = "<p>Enter your content here</p>"; 
    public double SliderValue = 20; 
 
    public DatePickerModel DateModel = new DatePickerModel() 
    { 
        Placeholder = "Select date" 
    }; 
    public DateTimePickerModel<DateTime> DateTimeModel = new DateTimePickerModel<DateTime>() 
    { 
        Placeholder = "Select date" 
    }; 
    public DropDownListModel<string> DropModel = new DropDownListModel<string>() 
    { 
        Placeholder = "Android", 
        DataSource = new string[] { "Android", "JavaScript", "jQuery", "TypeScript", "Angular", "React", "Vue", "Ionic" } 
    }; 
    public MaskedTextBoxModel MaskedModel = new MaskedTextBoxModel() 
    { 
        Mask = "000-000-000" 
    }; 
    public NumericTextBoxModel<string> NumericModel = new NumericTextBoxModel<string>() 
    { 
        Placeholder = "Enter number" 
    }; 
    public TextBoxModel TextModel = new TextBoxModel() 
    { 
        Placeholder = "Enter some text" 
    }; 
    public AutoCompleteModel<string> AutocompModel = new AutoCompleteModel<string>() 
    { 
        Placeholder = "Select frameworks", 
        DataSource = new string[] { "Android", "JavaScript", "jQuery", "TypeScript", "Angular", "React", "Vue", "Ionic" } 
    }; 
    public ComboBoxModel<string> ComboBoxModel = new ComboBoxModel<string>() 
    { 
        Placeholder = "Select frameworks", 
        DataSource = new string[] { "Android", "JavaScript", "jQuery", "TypeScript", "Angular", "React", "Vue", "Ionic" } 
    }; 
    public DateRangePickerModel DateRangeModel = new DateRangePickerModel() 
    { 
        Placeholder = "Select date" 
    }; 
    public MultiSelectModel<string> MultiModel = new MultiSelectModel<string>() 
    { 
        Placeholder = "Select frameworks", 
        DataSource = new string[] { "Android", "JavaScript", "jQuery", "TypeScript", "Angular", "React", "Vue", "Ionic" } 
    }; 
    public RichTextEditorModel RteModel = new RichTextEditorModel() 
    { 
        Placeholder = "Enter your content here" 
    }; 
    public TimePickerModel<string> TimeModel = new TimePickerModel<string>() 
    { 
        Placeholder = "Select date" 
    }; 
} 
 
Regards, 
Indrajith 



BR Brian July 16, 2020 01:50 AM UTC

Really? Actually your NumericTextBoxModel even dosen't have a "Min" property (nor "Max"). Are you sure you have tested the suggestion above? 


IS Indrajith Srinivasan Syncfusion Team July 16, 2020 02:40 PM UTC

Hi Brian,

We deeply regret for the inconvenience caused,
 

We have included the missing properties, including the Min and Max properties with NumericTextBoxModel and the fix will be included with our next patch release on 21st July. Until then, we suggest you to use the already suggested workaround.

Regards,
 
Indrajith 



PM Pandiyaraj Muniyandi Syncfusion Team July 21, 2020 03:01 PM UTC


Thanks for your patience, 
 

We have resolved the reported issue “When clearing the numeric value, default value is not set properly when Inplace-editor placed inside table” and the fix is now available with the NuGet package version 18.2.46. Also missing properties with Models are included with this NuGet.
 
 
Release Notes: https://blazor.syncfusion.com/documentation/release-notes/18.2.46/?type=all#in-place-editor

Can you please upgrade your package to this version to resolve the issue from your end? 
 
 
 
Regards, 
Pandiyaraj 



BR Brian July 23, 2020 02:02 AM UTC

No you didn't resolve it. If you update the sample project I provided at the first post to 18.2.0.46, you will see my issue No.1 still occurs. That is, In-place editor in Index.razor still sets its value to -1 when clear button is clicked.

Please re-check the issue, thanks.


IS Indrajith Srinivasan Syncfusion Team July 24, 2020 02:05 PM UTC

Hi Brian,

We have validated your reported query. We suggest you to use the NumericTextboxModel instead of object type to resolve the issue value resetting to -1.
 
 
Please get back to us if you face any difficulties, 
 
Regards, 
Indrajith 



BR Brian July 27, 2020 08:00 AM UTC

I'm sorry, I meant "0", not "-1" was still set to the In-place Editor of Index.razor. I made a typo. And of course I have used NumericTextBoxModel<int?> instead. I attached the updated sample, You can check for the problem.

Attachment: SyncfusionBlazorModel_64a272af.rar


IS Indrajith Srinivasan Syncfusion Team July 28, 2020 02:06 PM UTC

Hi Brian, 
 
We have validated your reported query and able to reproduce the issue. The reported issue occurs in index.razor  file, since the parent width of the element is auto. In such cases, when clearing the value of the NumericTextBox the min value is set. We suggest you to set the Width for the NumericTextBoxModel to resolve the reported issue. 
 
 
public NumericTextBoxModel<int?> NumericModel = new NumericTextBoxModel<int?>()  
    {  
        Width: “200px” 
    };  
 
 
 
Also, this is not an issue with the component it is the behavior of component if the parent width is auto. 
 
Regards, 
Indrajith 



BR Brian July 29, 2020 12:58 AM UTC

Thanks for your advice. However, before I try the solution, I have an argument about the mechanism you explained. I think it's unreasonable to relate a component's behavior to its appearance. That is, Whether the NumericTextBox clear its value or not depends on its width, it's of course improper. So I still hope you can work on that and deem it as a bug.

Regards.


IS Indrajith Srinivasan Syncfusion Team July 30, 2020 02:24 PM UTC

Hi Brian,

Good day to you,
 
 
We have further validated the reported query and have considered “NumericTextBox value is not set properly when clearing value with in-place editor“ as a bug from our end and the fix will be included with our Volume 2 SP 1 release. Until then, we suggest you to resolve the issue by setting the width for the NumericTextboxModel. 
 
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/16576/ 
 
Regards, 
Indrajith 



BR Brian July 31, 2020 12:19 AM UTC

I am so glad to know you have taken my opinion. Hope you can improve that soon.

Regards.


IS Indrajith Srinivasan Syncfusion Team July 31, 2020 05:19 AM UTC

Hi Brain,

Sure, we will let you know once the reported issue is resolved.

Regards,
Indrajith


IS Indrajith Srinivasan Syncfusion Team September 4, 2020 01:22 PM UTC

Hi Brian, 

Thanks for your patience,
 
 
We have resolved the issue “NumericTextBox value is not set properly when clearing value with in-place editor ” with the Nuget package version 18.2.46. 
 
 
Can you please upgrade your package to this version to resolve the reported issue from your end ?

Regards,
Indrajith

Loader.
Up arrow icon