Problem Negative number in android.

Version 19.1.0.59

The negative number is delete a minus when lost focus the control. If I type the minus before typing the muber it will be ok. But if I type it at the last the bug appear.

My code:

    var format = "### ##0";
            var decimalSeparate = ".";
            var groupSeparate = " ";
            var maxDigits = format.Contains(decimalSeparate) ? format.Length - format.IndexOf(decimalSeparate) - 1 : 0;
            var range = Math.Pow(10, format.Remove(decimalSeparate).Remove(groupSeparate).Length - maxDigits) - 1 / Math.Pow(10, maxDigits);
            var numberGroupSizes = format?.Split(decimalSeparate[0])[0].Split(groupSeparate[0]).Select(x => x.Length).Reverse().ToArray();

            var s = new StackLayout { Spacing = 0 };
            var n = new SfNumericTextBox
            {
                HeightRequest = 50,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                TextAlignment = TextAlignment.Start,
                ReturnType = ReturnType.Done,
                ParserMode = Parsers.Decimal,
                ClearButtonVisibility = Syncfusion.XForms.Editors.ClearButtonVisibilityMode.Never,
                ValueChangeMode = ValueChangeMode.OnLostFocus,
                MaximumNumberDecimalDigits = maxDigits,
                FormatString = format
            };

            if (DeviceInfo.Platform != DevicePlatform.Android || numberGroupSizes.Length > 1)
            {
                n.GroupSeparatorMode = GroupSeparatorMode.Always;
                n.EnableGroupSeparator = true;
            }

Thank you, I hope this bug will be fix as soon as possible.

Best regard



17 Replies 1 reply marked as answer

HQ Hong Quang Hung May 12, 2021 01:11 AM UTC

I also have a question. In Android platform, When I type number, the NumberGroupSeparator is comma athougth I set n.Culture.NumberFormat.NumberGroupSeparator = " ". On IOS is work perfectly.




SS Sridevi Sivakumar Syncfusion Team May 12, 2021 02:03 PM UTC

Hi Hong Quang Hung,

Greetings from Syncfusion.

Query: The minus when lost focus the control
We have checked the reported issue, and the issue is reproduced in XForms android, when set the GroupSeparatorMode is Always. Currently, we are validating the reported query and we will update the details on May 13, 2021.

Query: In the Android platform, When I type a number, the NumberGroupSeparator is a comma although I set n.Culture.NumberFormat.NumberGroupSeparator = " ".
The group separator will be changed based on the device's current culture. We can't set the culture through n.Culture.NumberFormat.NumberGroupSeparator. 

For more information about how to use the numeric textbox culture property
https://help.syncfusion.com/xamarin/numeric-entry/localization 
 
Regards, 
Sridevi S. 



HQ Hong Quang Hung May 13, 2021 10:25 AM UTC

Thanks your answer, with above code:

Q1: I replace ValueChangeMode = ValueChangeMode.OnKeyFocus. If I set Maximum = "555555", the number will be set 555.56 when unfocus this control. If I set Maximum = "555555.55" and type max value, it will be crash and show exception System.FormatException: 'Input string was not in a correct format.' The error is only in Android. It seem happen when the value > Maximum but event ValueChanged invokes. In IOS, the event not fire.

Q2: The group separator will be changed based on the device's current culture and it is comma. How to change it to space like format. ( I have set culture on IOS and it successed).

Q3: I update the control to v19.1.0.63, The minus when lost focus the control is not fixed. 

I hope Syncfusion reply my question and help me resolve with my problem.

Thanks,



SS Sridevi Sivakumar Syncfusion Team May 13, 2021 04:08 PM UTC

Hi Hong Quang Hung,

Query: The minus when lost focus the control
We have validated the reported issue and confirmed [Android] Minus sign removed while GroupSeparatorMode is always and enter minus after type numbers
 as an issue. The fix will be included in our next Weekly NuGet release which is scheduled to be rolled out on May 27, 2021. We appreciate your patience until then. 

You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.


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

Query: ValueChangeMode = ValueChangeMode.OnKeyFocus. If I set Maximum = "555555", the number will be set 555.56 when unfocus this control. If I set Maximum = "555555.55" and type max value, it will be crash and show exception System.FormatException: 'Input string was not in a correct format.'

We have checked the reported query and we can able to reproduce the reported problems. Currently we are validating, and we will update the details on May 17,2021.

Query: It seem happen when the value > Maximum but event ValueChanged invokes. In IOS, the event not fire.
The group separator will be changed based on the device's current culture and it is comma. How to change it to space like format. ( I have set culture on IOS and it successed).

Currently we are checking the reported query and we will update the details on May 17,2021.

Regards,
Sridevi S.
 



SS Sridevi Sivakumar Syncfusion Team May 17, 2021 12:34 PM UTC

Hi Hong Quang Hung,

Query: ValueChangeMode = ValueChangeMode.OnKeyFocus. If I set Maximum = "555555", the number will be set 555.56 when unfocus this control. If I set Maximum = "555555.55" and type max value, it will be crash and show exception System.FormatException: 'Input string was not in a correct format.'
We have validated the reported queries and confirmed as an issue. The fix will be included in our next Weekly NuGet release which is scheduled to be rolled out on May 27, 2021. We appreciate your patience until then.

You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.

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

Query: The group separator will be changed based on the device's current culture and it is comma. How to change it to space like format. ( I have set culture on IOS and it successed).

We would like to inform you that, you can change the group separator as space by using the below code snippet
 
CultureInfo cultureInfo = new System.Globalization.CultureInfo("fr-FR"); 
cultureInfo.NumberFormat = new NumberFormatInfo()
{
NumberGroupSeparator = " "
};
  
n.Culture = cultureInfo; 
 

Query: It seems to happen when the value > Maximum but event ValueChanged invokes. In IOS, the event not fire.
ValueChanged event is fired properly if the value is greater than or less than the maximum value.  We have prepared a sample for your requirement please have a sample from the below link
https://www.syncfusion.com/downloads/support/directtrac/general/ze/sample_(10)1907349370

Since we are not aware of your exact application scenario, we were not able to reproduce this at our end, can you please revert us by modifying the sample based on your application along with the replication procedure.

Regards,
Sridevi S.
 



HQ Hong Quang Hung May 18, 2021 01:32 AM UTC

Thanks Syncfusion,
I am most graceful with your support for my problem. I will try this solution to my issue.
Query: It seems to happen when the value > Maximum but event ValueChanged invokes. In IOS, the event not fire. It Happens when format such as ### ##0.00.
Note: I set CurrentCulture and CurrentUICulture is new CultureInfo("en-US").

Regards,
Hong Quang Hung


SS Sridevi Sivakumar Syncfusion Team May 18, 2021 01:21 PM UTC

Hi Hong Quang Hung,

We can able to reproduce the "ValueChanged event not fired" problem when set the SfNumericTextBox ValueChangeMode is onLostFocus.  Can you please confirm whether you have faced this problem with this mentioned case (ValueChangeMode as onLostFocus) ?

Regards,
Sridevi S.
 



HQ Hong Quang Hung May 18, 2021 01:41 PM UTC

In case ValueChangeMode as onLostFocus. It is perfect. App crash when I set OnkeyFocus and format is have decimal digit (### ###.00).


SS Sridevi Sivakumar Syncfusion Team May 19, 2021 01:25 PM UTC

Hi Hong Quang Hung,

Query 1: ValueChanged event not fired
In your earlier update, you have mentioned “
In IOS, the event not fire”. We have checked and ensured, SfNumericTextBox ValueChanged event is fired properly when set ValueChangeMode is OnkeyFocus. Please have video from the below link

Video link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Video_(2)1638555671.zip

If you are facing the issue in OnkeyFocus mode,  please share the platform that you are using to reproduce the problem.

We have faced event not triggered in ValueChangeMode on LostFocus in second time: If I type a value greater than the Maximum value and then unfocus the control, the event is triggered. However, after clearing the value and repeating the operation, the event not triggered.

Can you please explain are facing the event not fired problem in ValueChangeMode OnkeyFocus or onLostFocus and share the issue reproducing platform also.


With the complete details, please create a separate incident or forum for better follow up for this query.

Query 2: App crash when I set OnkeyFocus and format is have decimal digit (### ###.00)

We can able to reproduce this crash and this issue related with your already reported scenario. We have already logged issue and mentioned the related issue and feedback link below, please find it.

Related issue : 
Set ValueChangeMode as OnKeyFocus and set Maximum = "555555.55", and type maximum value. It throws format exception

Feedback link: https://www.syncfusion.com/feedback/25309/android-minus-sign-removed-while-groupseparatormode-is-always-and-enter-minus
 
Please review the above feedback link if you want to know the bugs that have already been promised to you.

As we mentioned, we will update you the fix in May 27, 2021. We appreciate your patience until then.

Regards,
Sridevi S.
 
 



HQ Hong Quang Hung May 20, 2021 01:20 AM UTC

I  think you understood my problem. 
Query 1
ValueChangeMode = ValueChangeMode.OnKeyFocus
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
I mention "In IOS, the event not fire". In case value has been set a maximum Value and you keep type value continuative and The event fire in AndroidBut I mentioned Query 2 in Android  and I predict it by Query 1 (I appriciate the event in Android is not fired as IOS, I don't want you test this case). 

My apologies for giving you the wrong information.
Thanks,


SS Sridevi Sivakumar Syncfusion Team May 20, 2021 02:31 PM UTC

Hi Hong Quang Hung, 

As per our previous update,  we will add fix for “app crash issue in android platform” on  May 27, 2021 weekly NuGet.

Can you please confirm still are you facing a "ValueChanged event not fired" problem in iOS on key focus?

If so, can you please share the below reported details?   
            Share the issue reproducing  video, and sample? 
 
Regards,
Sridevi S. 



HQ Hong Quang Hung May 21, 2021 06:11 AM UTC

Hi Sridevi Sivakumar,
Can you please confirm still are you facing a "ValueChanged event not fired" problem in iOS on key focus?
Answer:
It is not a problem in IOS. I never say that. I only said "In IOS, the event fired". The problem is Android, the event fire, I want this event not invoke. Therefore, you need test it in Android not IOS. Sorry, my language is not good to misunderstand. I just want explain the reason why the app crash in android. ( app crash issue in android platform)

Thank,



SS Sridevi Sivakumar Syncfusion Team May 21, 2021 11:17 AM UTC

Hi Hong Quang Hung,

Thanks for your update.

As we mentioned, we will update you the fix in May 27, 2021. We appreciate your patience until then.

Regards,
Sridevi S.
 
 



SS Sridevi Sivakumar Syncfusion Team May 27, 2021 12:48 PM UTC

Hi Hong Quang Hung,

We have fixed the below
feedback mentioned issues.
https://www.syncfusion.com/feedback/25309/android-minus-sign-removed-while-groupseparatormode-is-always-and-enter-minus


The patch and NuGet for the fix can be downloaded from the below link

Please find the patch from below link
 
 
https://syncfusion.com/Installs/support/patch/19.1.0.63/1355501/F165363/SyncfusionPatch_19.1.0.63_1355501_5272021051821727_F165363.exe

Please find the patch assemblies alone from below location:
https://syncfusion.com/Installs/support/patch/19.1.0.63/1355501/F165363/SyncfusionPatch_19.1.0.63_1355501_5272021051821727_F165363.zip

Please find the NuGet from below location:  
https://syncfusion.com/Installs/support/patch/19.1.0.63/1355501/F165363/SyncfusionNuget_19.1.0.63_1355501_5272021051821727_F165363.zip

Assembly Version: 19.1.0.63
Disclaimer:
Please note that we have created this patch for version 19.1.0.63 specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received
.

To Clear the cache:
  
Follow the below link to clear cache,    
 
https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache

The fix will be included in our weekly NuGet release which is expected to be rolled out on June 1, 2021.


We appreciate your patience until then.

Regards,
Sridevi S. 
 
 



SS Sridevi Sivakumar Syncfusion Team June 1, 2021 11:23 AM UTC

Hi Hong Quang Hung,

We have fixed the below feedback mentioned issues and the fix is included in our weekly NuGet of  June 1, 2021.

https://www.syncfusion.com/feedback/25309/android-minus-sign-removed-while-groupseparatormode-is-always-and-enter-minus

NuGet Version: 19.1.0.66

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Sridevi S.
 


Marked as answer

HQ Hong Quang Hung June 2, 2021 02:36 AM UTC

Thanks Syncfusion.

My problem has been resolved.

Regard,

Hong Quang Hung


SS Sridevi Sivakumar Syncfusion Team June 2, 2021 04:57 AM UTC

Hi Hong Quang Hung,

We are glad that the reported problem is resolved at your end, please let us know if you need any other assistance.

Regards,
Sridevi S. 


Loader.
Up arrow icon