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

[RN]"boxSizing" is not a valid style property #4643

Closed
everfire130 opened this issue Oct 22, 2019 · 5 comments
Closed

[RN]"boxSizing" is not a valid style property #4643

everfire130 opened this issue Oct 22, 2019 · 5 comments
Assignees

Comments

@everfire130
Copy link

[复现问题的步骤]

  1. 写一个带box-sizing属性的scss及使用到页面上
  2. npm run dev:rn
  3. 用taro-native-shell打开应用
    4721571711193_ pic_hd
@taro-bot
Copy link

taro-bot bot commented Oct 22, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Garfield550
Copy link
Collaborator

flexbox in RN doesn’t have box-sizing property but flex items behave as if they have box-sizing: content-box (not border-box - that is padding and border are not included in component’s width and height).

Ref: http://blog.tap349.com/react-native/flexbox/2017/11/18/react-native-layout/#box-sizing

React Native styles all views as if box-sizing: border-box is set. See this code: https://github.com/facebook/react-native/blob/5aa1fb3ff326a429e33a443576da866f2a63c20c/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java#L632

Ref: https://stackoverflow.com/questions/38503451/does-it-exist-an-equivalent-of-box-sizing-border-box-in-flexbox-for-react-nativ

@everfire130
Copy link
Author

I know.But how to ignore the property in taro. @Garfield550

@taro-bot
Copy link

taro-bot bot commented Oct 22, 2019

CC @Pines-Cheng

@Pines-Cheng
Copy link
Contributor

Pines-Cheng commented Oct 22, 2019

@everfire130 样式代码的条件编译

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

No branches or pull requests

3 participants