Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Stepper rounds initial value #10032

Closed
RonnyBansemer opened this issue Mar 19, 2020 · 4 comments
Closed

[Bug] Stepper rounds initial value #10032

RonnyBansemer opened this issue Mar 19, 2020 · 4 comments
Assignees
Labels
4.4.0 regression on 4.4.0 a/stepper i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression t/bug 🐛
Milestone

Comments

@RonnyBansemer
Copy link

Description

The Stepper (material renderer) changes the initial value of the value property (2-way-binding).
A bound value, lets say 4.99, with stepper increment 0.1 leads to rounding value to 5.00.

Steps to Reproduce

  1. Create a Stepper, bind the value property to it, 2-way-mode
  2. Specify Stepper increment value, e.g. 0.1
  3. Assign a value to value property in view model, which is more precise than 0.1, e.g. 4.99

Expected Behavior

Stepper should in-/decrement the initial value by 0.1 (--> 5.09, 5.19,... ) until min-/max-value is reached.

Actual Behavior

Stepper initial value is rounded after binding from 4.99 to 5.00 (--> 5.10, 5.20, ...).

Basic Information

  • Version with issue: XF 4.5.0.396
  • Android: 8.1
  • Nuget Packages: Xamarin.Forms, Xamarin.Forms.Visual.Material
@RonnyBansemer RonnyBansemer added s/unverified New report that has yet to be verified t/bug 🐛 labels Mar 19, 2020
@pauldipietro pauldipietro added this to New in Triage Mar 19, 2020
@jfversluis
Copy link
Member

jfversluis commented Mar 20, 2020

I think this might be introduced by #7383

Just so we can get a clear picture of what you are trying to do. Can I ask you to add a small reproduction sample that shows the issue?

You mention Android, did you try it on iOS at all? And with a non-Material Stepper?

@jfversluis jfversluis added a/stepper s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Mar 20, 2020
@jfversluis jfversluis moved this from New to Needs Info in Triage Mar 20, 2020
@samhouts samhouts moved this from Needs Info to New in Triage Mar 20, 2020
@samhouts samhouts moved this from New to Needs Info in Triage Mar 20, 2020
@RonnyBansemer
Copy link
Author

@jfversluis I did not check it with iOS and a non-material Stepper. I Will check it tomorrow and apply a test project.

@RonnyBansemer
Copy link
Author

@jfversluis Sorry, I just had time to create the sample project. I did not test it on iOS, the Android default renderer are also affected. There you go: https://github.com/RonnyBansemer/StepperRoundingIssue

image

@jfversluis
Copy link
Member

jfversluis commented Mar 30, 2020

No worries @RonnyBansemer thanks for taking the time to do this!

To verify if it also happens on iOS, I pasted all the bits into a new project. My File > New project came with Forms 4.4 where this bug didn't happen, then upgraded to the latest stable and I suddenly see this on both Android and iOS. Fairly sure it's because of the change I mentioned earlier.

Also tested with the latest nightly and still happens.

Repro10032.zip

@jfversluis jfversluis added 4.4.0 regression on 4.4.0 i/regression p/iOS 🍎 and removed s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified labels Mar 30, 2020
@jfversluis jfversluis moved this from Needs Info to Ready For Work in Triage Mar 30, 2020
@samhouts samhouts moved this from Ready For Work to Needs Estimate in Triage Apr 1, 2020
@samhouts samhouts added this to To do in Visual Apr 10, 2020
@samhouts samhouts added this to the 4.4.0 milestone Apr 14, 2020
@samhouts samhouts added this to To do in v4.4.0 Apr 14, 2020
@samhouts samhouts removed this from the 4.4.0 milestone Apr 17, 2020
@StephaneDelcroix StephaneDelcroix self-assigned this Jun 30, 2020
@StephaneDelcroix StephaneDelcroix removed this from To do in Visual Jun 30, 2020
@StephaneDelcroix StephaneDelcroix added this to the 4.8.0 milestone Jun 30, 2020
@StephaneDelcroix StephaneDelcroix moved this from Needs Estimate to Ready For Work in Triage Jun 30, 2020
@StephaneDelcroix StephaneDelcroix added the i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often label Jun 30, 2020
@samhouts samhouts moved this from Ready For Work to Needs Estimate in Triage Jul 1, 2020
StephaneDelcroix added a commit that referenced this issue Jul 8, 2020
Round stepper values so we can pretend they're not FP numbers but obey
the decimal logic. Rounding happen at n+4 position, n being the position
of the most significant digit of the increment. That gives up to 4
significant digit to the increment.

- fixes #5168 (for good)
- fixes #10032
- fixes #11169
Triage automation moved this from Needs Estimate to Closed Jul 13, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Jul 30, 2020
@samhouts samhouts moved this from In Progress to Done in vCurrent (4.8.0) Jul 30, 2020
@samhouts samhouts removed this from Closed in Triage Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.4.0 regression on 4.4.0 a/stepper i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression t/bug 🐛
Projects
No open projects
v4.4.0
  
To do
Development

No branches or pull requests

4 participants