-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SliderIOS] Apply value after minimum/maximumValue in order to ensure it is properly set #835
Conversation
While this solution works, I do wonder if it's worth adding a hook on view manager classes that allows us to specify in what order props should be applied, either in JS or Objective-C. eg: instead of having // RCTSliderManager.m
- (NSArray *)applyPropsFirst
{
return @[ @"minimumValue", @"maximumValue" ];
} or... // RCTSliderManager.m
- (NSArray *)propsOrder
{
return @[ @"minimumValue", @"maximumValue", @"value" ];
} This would have been helpful for me on @tadeuzagallo - thoughts? cc @vjeux |
- `value` is clamped between min/max and so order of prop application matters
ping @tadeuzagallo - simple change here that we discussed in IRC, would be good to get it into next sync if possible |
I've been trying to land this today, but ran into an unexpected merge conflict. Should be sorted shortly. |
… it is properly set Summary: `value` is clamped between min/max and so order of prop application matters - `value` always ended up being set first in my tests, and consequently a value outside of the default range 0-1 would not work. So this applies the value when the min/max are set. [Gist of broken example](https://gist.github.com/brentvatne/fc637b3e21d012966f3a) ![screenshot](http://url.brentvatne.ca/SQPC.png) ^ the second slider here should have it's cursor in the middle /cc @tadeuzagallo Closes facebook/react-native#835 Github Author: Brent Vatne <brent.vatne@madriska.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
… it is properly set Summary: `value` is clamped between min/max and so order of prop application matters - `value` always ended up being set first in my tests, and consequently a value outside of the default range 0-1 would not work. So this applies the value when the min/max are set. [Gist of broken example](https://gist.github.com/brentvatne/fc637b3e21d012966f3a) ![screenshot](http://url.brentvatne.ca/SQPC.png) ^ the second slider here should have it's cursor in the middle /cc @tadeuzagallo Closes facebook/react-native#835 Github Author: Brent Vatne <brent.vatne@madriska.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
value
is clamped between min/max and so order of prop application matters -value
always ended up being set first in my tests, and consequently a value outside of the default range 0-1 would not work. So this applies the value when the min/max are set.Gist of broken example
^ the second slider here should have it's cursor in the middle
/cc @tadeuzagallo