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

webview auto jump to previous height #24232

Closed
CocoaZX opened this issue Apr 1, 2019 · 4 comments
Closed

webview auto jump to previous height #24232

CocoaZX opened this issue Apr 1, 2019 · 4 comments
Labels
Bug Component: WebView Related to the WebView component. Resolution: Locked This issue was locked by the bot.

Comments

@CocoaZX
Copy link

CocoaZX commented Apr 1, 2019

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

@react-native-bot
Copy link
Collaborator

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-bot react-native-bot added the Component: WebView Related to the WebView component. label Apr 1, 2019
@CocoaZX
Copy link
Author

CocoaZX commented Apr 1, 2019

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: 81.12 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.59.2 => 0.59.2
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

update the react-native , bug still there

@guhungry
Copy link
Contributor

guhungry commented Apr 1, 2019

@CocoaZX WebView was extracted to https://github.com/react-native-community/react-native-webview so could you retest and report there.
Migration should be easy and pretty strait forward.

@kelset
Copy link
Contributor

kelset commented Apr 1, 2019

(thanks @guhungry for the comment!)

@kelset kelset closed this as completed Apr 1, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Apr 1, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: WebView Related to the WebView component. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants