Comments (6)
@huanghaodong I make dummy wrapper:
import React, {Component} from 'react'
import {Platform} from 'react-native'
import {AutoGrowingTextInput} from 'react-native-autogrow-textinput'
export class AutoGrowingTextInputFixed extends Component {
constructor(props) {
super(props)
this.state = {
height: 0,
}
this.forceResize = this.forceResize.bind(this)
}
forceResize(event) {
const {nativeEvent} = event
if (
Platform.OS !== 'ios' &&
nativeEvent &&
nativeEvent.contentSize &&
nativeEvent.contentSize.height !== this.height
) {
this.height = event.nativeEvent.height
this.input._handleNativeEvent(nativeEvent)
}
}
render() {
return (
<AutoGrowingTextInput
{...this.props}
onContentSizeChange={this.forceResize}
ref={ref => (this.input = ref)}
/>
)
}
}
I hope developers will fix it.
from react-native-autogrow-textinput.
Problem with enent in "_handleNativeEvent(event)", event dosn't have contentSize property.
Next in "_onContentSizeChangeAndroid(event)", we have contentSize property with correnc height
from react-native-autogrow-textinput.
thank you!so what should i do?
from react-native-autogrow-textinput.
Is it fixed or not yet ?
from react-native-autogrow-textinput.
It's not fixed yet :(. moreover, @BATMAH69 fix is not valid in version 5.0.0 as the function _handleNativeEvent doesn't exist...
from react-native-autogrow-textinput.
The latest published version (5.0.0) is now compatible with modern RN versions (>= 51).
RN now comes out of the box with auto-growing multiline input on both platforms so there is no need of handling the height in JS. If you don’t need any of the other features of this package, regular input should be enough.
from react-native-autogrow-textinput.
Related Issues (20)
- undefined is not an object (evaluating '_react.PropTypes.bool') HOT 1
- Double dispatch async to main queue
- please upgrade react version HOT 2
- 引入组件就直接报错了
- Cannot read property 'bool' of undefined HOT 3
- 5.0.0 is not working on android - height is not changing. HOT 7
- "RCTTextView.h" file not found on react-native 0.54.0 HOT 5
- Possible uppercase bug? HOT 6
- .clear() does not clear TextInput
- Different fontSize even with TextInput and AutoGrowingTextInput set to same size?
- Web implementation HOT 2
- :react-native-autogrow-textinput:verifyReleaseResources FAILED AAPT: error: resource android:attr/colorError not found. HOT 3
- 'React/RCTUIManager.h' file not found HOT 2
- Paste option is not working HOT 2
- Not working on Android, which version to use for RN 0.46.4
- Add a podspec HOT 1
- Not working with React Native 0.62.0 HOT 2
- [IOS] keyboard doesn't scroll up accordingly when used inside a 'formSheet' modal ?
- Expo? HOT 2
- editText.setBlurOnSubmit(false); HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-autogrow-textinput.