-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
TextInput box with Limited height doesn't focus to end of line after input exceeds height (RN 47.1, 45.1) #15778
Comments
No one else facing this problem? |
Seeing something potentially related, I'm getting a weird |
@allpwrfulroot, there was a bug reported about that and was supposedly fixed for 47.2. I'm seeing this problem only on Android btw and only if I limit the expanding input field to x lines by the code above. If I let the input box keep growing, no problem |
I'm seeing this on Android, too. |
Actually, duplicate of #12799. |
@jamesreggio Yes, didn't see that before I submitted, even though I went through the TextInput issues before I submitted this one. So I'm not alone... So it's been broken for most of the 40+ versions of RN and hasn't been fixed... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
Summary: This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason. The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases. I also add a contentSize tracking in the example app to make sure that it is unaffected by this change. https://pxl.cl/9RHP #12799 #15778 Special thanks to konradkierus! Reviewed By: sahrens Differential Revision: D6405985 fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
Summary: This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason. The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases. I also add a contentSize tracking in the example app to make sure that it is unaffected by this change. https://pxl.cl/9RHP #12799 #15778 Special thanks to konradkierus! Reviewed By: sahrens Differential Revision: D6405985 fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
Summary: This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason. The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases. I also add a contentSize tracking in the example app to make sure that it is unaffected by this change. https://pxl.cl/9RHP facebook#12799 facebook#15778 Special thanks to konradkierus! Reviewed By: sahrens Differential Revision: D6405985 fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
Summary: This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason. The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases. I also add a contentSize tracking in the example app to make sure that it is unaffected by this change. https://pxl.cl/9RHP facebook/react-native#12799 facebook/react-native#15778 Special thanks to konradkierus! Reviewed By: sahrens Differential Revision: D6405985 fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
Summary: This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason. The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases. I also add a contentSize tracking in the example app to make sure that it is unaffected by this change. https://pxl.cl/9RHP facebook#12799 facebook#15778 Special thanks to konradkierus! Reviewed By: sahrens Differential Revision: D6405985 fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
Summary: This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason. The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases. I also add a contentSize tracking in the example app to make sure that it is unaffected by this change. https://pxl.cl/9RHP facebook#12799 facebook#15778 Special thanks to konradkierus! Reviewed By: sahrens Differential Revision: D6405985 fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
Is this a bug report?
YES
Have you read the Contributing Guidelines?
YES
Environment
react-native -v
:react-native-cli: 2.0.1
react-native: 0.47.1
node -v
:v7.10.1
npm -v
:4.2.0
yarn --version
:Then, specify:
Target Platform:
iOS, Android - Problem only reproducable on Android right now.
Development Operating System: MacOS 10.12,
Build tools: Android Studio 2.3.3
Steps to Reproduce
`
import React from 'react';
import { StyleSheet, Text, View, TextInput, Platform } from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props)
this.state = {
value: '',
height: 20
}
this.onContentSizeChange = this.onContentSizeChange.bind(this)
}
onContentSizeChange(e) {
const contentSize = e.nativeEvent.contentSize
this.setState({height: contentSize.height > 100 ? 100 : contentSize.height})
console.log(this.state.height)
}
render() {
return (
Open up App.js to start working on your app!
Changes you make will automatically reload.
Shake your phone to open the developer menu.
<TextInput
placeholder = 'type your text here'
multiline = {true}
style = {[styles.textInput,{height: this.state.height, width: 200}]}
value = {this.state.text}
onContentSizeChange={(e)=> this.onContentSizeChange(e)}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
paddingTop: 40,
paddingHorizontal: 10
},
textInput: {
marginLeft: 10,
fontSize: 16,
lineHeight: 18,
marginTop: Platform.select({
ios: 6,
android: 0,
}),
marginBottom: Platform.select({
ios: 5,
android: 3,
}),
},
});
`
Expected Behavior
The focus of the text input should remain at the last character input.
Actual Behavior
Focus of the text input is outside the visible area
Reproducible Demo
See the example code listed above.
The text was updated successfully, but these errors were encountered: