Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Fixed the min/max range for when default value is 0 (previously stepper was disabled if default was 0) #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

drohit
Copy link

@drohit drohit commented May 13, 2016

I set default value to 0 and noticed that I couldn't increment up or down. Noticed that this wasn't the case for floats, and so I applied the fix for _FBTweakTableViewCellModeInteger.

@ghost
Copy link

ghost commented May 13, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@drohit
Copy link
Author

drohit commented May 13, 2016

Signed up!

@ghost
Copy link

ghost commented May 13, 2016

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ghost ghost added the CLA Signed label May 13, 2016
@grp
Copy link
Contributor

grp commented May 14, 2016

The issue here is that with a zero default value and no explicit minimum and maximum, there's no way to know what an appropriate magnitude is for the value. Should it be from -1000 to +1000 or -0.001 to +0.001 — there's no way to know. So I'm worried this might appear to help in some cases but might be more confusing in cases where the magnitude is guessed wrong?

@drohit
Copy link
Author

drohit commented May 14, 2016

That makes sense. However, when dealing with the _FBTweakTableViewCellModeReal, this check is made and the minimum and maximum values were set to -1 and 1 respectively. I thought for consistency purposes, it would be nice to have that as the range for the _FBTweakTableViewCellModeInteger as well. Furthermore, as a user, when I used this, I was confused as to why it was disabled for my properties that were defaulted to 0.

Perhaps I could implement an easy to use setMin/setMax for the user for maximum clarity?
Please let me know what you think!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants