Skip to content

WebView stopLoading no longer working in onNavigationStateChange on Android #15679

@tss101

Description

@tss101

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 6.11.2
Yarn: 0.15.1
npm: 3.10.10
Watchman: 4.9.0
Xcode: Xcode 8.2 Build version 8C38
Android Studio: 2.2 AI-145.3537739

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.53.3 => 0.53.3 (reproduced in react-native: 0.54.2, 0.55.4)

Steps to Reproduce

  1. Create a Webview in 0.54.0, point it to a url with an embedded youtube video (iframe) or link
  2. Call stopLoading in onNavigationStateChange

Expected Behavior

Newly clicked url stops loading

Actual Behavior

Url keeps loading

Reproducible Demo

export var TestWebContentView = createReactClass( {displayName: 'TestWebContentView',
    handleNavigationChange: function(navState) {
         console.log(navState)
         this.webview.stopLoading();
        }
    },
    render: function() {
        return (
            <View style={rootViewStyle} >
                <WebView
                ref={(ref) => { this.webview = ref; }}
                scrollEnabled={false}
                source={{uri: 'http://www.simplehtmlguide.com/livedemo.php?e=youtube2' }}
                startInLoadingState={false}
                mixedContentMode={'always'}
                scalesPageToFit={false}
                onNavigationStateChange={this.handleNavigationChange}
                allowsInlineMediaPlayback={true}
                automaticallyAdjustContentInsets={false}
                />
            </View>
        )
    }
})

I'm quite stumped by this, since it was working a week or so ago on the same Android device, on react-native 0.44. However, I reverted the react-native version back to 0.44 and it's still not working. Might a Chrome update be responsible? iOS version appears to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: WebViewRelated to the WebView component.Help Wanted :octocat:Issues ideal for external contributors.Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.Platform: AndroidAndroid applications.Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions