-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
webview auto jump to previous height #24232
Comments
It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists. The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.
|
React Native Environment Info: update the react-native , bug still there |
@CocoaZX |
(thanks @guhungry for the comment!) |
import {
WebView,
} from 'react-native';
When open web first and scroll ,then navigation pop.
Then open web , no matter is the same web url or not ,the webView will scroll to last height.
I want webView not auto scroll .
`class MyWeb extends BaseComponent {
componentDidMount() {
this.webView = React.createRef();
}
render() {
const { url, title = '网页' } = this.props.navigation.state.params;
return (
<SafeAreaView
ref={(c) => {
this.webView = c;
}}
>
<MyNav title={title} opacity={0} style={{ width: '100%' }} />
<View
style={{
marginTop: 20,
width: '100%',
height: Dimensions.get('window').height,
}}
>
<WebView
source={{ uri: url }}
mixedContentMode="always"
startInLoadingState
scalesPageToFit
/>
);
}
}
`
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: 71.43 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.11.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 27, 28
Build Tools: 28.0.3
System Images: android-Q | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
react-native-cli: 2.0.1
The text was updated successfully, but these errors were encountered: