Skip to content
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

fix missing lines in the ios picker #13342

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion React/Views/RCTPickerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ @implementation RCTPickerManager

- (UIView *)view
{
return [RCTPicker new];
RCTPicker *picker = [RCTPicker new];
[picker selectRow:0 inComponent:0 animated:YES];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely should not configure it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats different than before? we are not configuring anything here, im just setting some defaults so the lines appear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just should be inside RCTPicker's init method, and View Managers should be as declarative as possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvinis can you address @shergin's feedback?

Copy link

@adnanbabar adnanbabar Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works fine within React/Views/RCTPickerManager.m but when I move it within RCTPicker's initWithFrame it doesn't work.
@shergin what am I doing wrong?

Thanks

screen shot 2018-03-01 at 13 39 10

return picker;
}

RCT_EXPORT_VIEW_PROPERTY(items, NSArray<NSDictionary *>)
Expand Down