react-native: WebView stopLoading no longer working in onNavigationStateChange on Android

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.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 11
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Can confirm that this is still not working in 0.55.4

Still an issue in v0.53.0!