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

Layout inconsistency between Switch & SwitchAndroid #3785

Closed
christopherdro opened this issue Oct 29, 2015 · 4 comments
Closed

Layout inconsistency between Switch & SwitchAndroid #3785

christopherdro opened this issue Oct 29, 2015 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@christopherdro
Copy link
Contributor

Switch

Switch

SwitchAndroid

SwtichAndroid

The width value here seems to be incorrect.
https://github.com/facebook/react-native/blob/master/Libraries/Components/Switch/Switch.js#L113

No exactly sure if this applies to all devices so I wanted to check before making any kind of PR.

@brentvatne
Copy link
Collaborator

@christopherdro - images seem to be broken :O could you update?

@christopherdro
Copy link
Contributor Author

@brentvatne loads for me on mobile

@christopherdro christopherdro changed the title Layout inconsistency between Switch & SwitchAdroid Layout inconsistency between Switch & SwitchAndroid Oct 31, 2015
@christopherdro
Copy link
Contributor Author

So there are a couple ways this can be fixed but wanted to get some feedback before submitted a PR. After talking to @mkonicek this last week at Reactive2015 he mentioned that size of the switch for android is calculated automatically whereas it need to be defined for IOS.

So I'm wondering if we should remove this section entirely

rctSwitchAndroid: {
height: 27,
width: 40,
},
, and then remove props.style = [styles.rctSwitchAndroid, this.props.style]; or alter it to props.style = this.props.style;

@mkonicek
Copy link
Contributor

mkonicek commented Nov 7, 2015

This looks like a bug, thanks for reporting!

@sahrens I think the fixed size was added as part of the universal Switch and SwitchAndroid doesn't do that? Can we remove this?

rctSwitchAndroid: {
height: 27,
width: 40,
},

christopherdro added a commit to christopherdro/react-native that referenced this issue Nov 23, 2015
christopherdro added a commit to wildlifela/react-native that referenced this issue Jan 20, 2016
Summary:
Fixed facebook#3785
Closes facebook#4298

Reviewed By: svcscm

Differential Revision: D2807289

Pulled By: mkonicek

fb-gh-sync-id: 6f161e4f8b04597726183fdcf8bc22c682557958
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants