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

contentSize is no longer defined within the onChange event. #1970

Closed
silvestreh opened this issue Oct 20, 2017 · 3 comments
Closed

contentSize is no longer defined within the onChange event. #1970

silvestreh opened this issue Oct 20, 2017 · 3 comments

Comments

@silvestreh
Copy link

Version

2.0.0

Environment

React Native 0.49

Reproduction link

https://codepen.io/anon/pen/zEbeoj

Steps to reproduce

There's not much to it. Just by using TextareaItem's autoHeight prop will make the app crash because of this line of code:

https://github.com/ant-design/ant-design-mobile/blob/master/components/textarea-item/index.native.tsx#L58

contentSize is no longer in event.nativeEvent if you're using React Native TextInput's onChange method. Instead, you should deal with contentSize changes in the new onContentSizeChange method as described in React Native's documentation.

What is expected?

The text area component should adjust its height.

What is actually happening?

The app is crashing because contentSize is no longer defined in event.nativeEvent.

@silentcloud
Copy link
Contributor

@silvestreh
Copy link
Author

silvestreh commented Oct 24, 2017

@silentcloud care to elaborate? I don't know why the issue is being closed. The demo app crashes when I enter text on a TextareaItem.

Here, I made a GIF to better illustrate the issue at hand:

textareaitem

@silentcloud
Copy link
Contributor

silentcloud commented Oct 25, 2017

@silvestreh fixed in this commit: a23235a, and will be released later

lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
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