How to disable zoom on react-native
web-view
,is there a property like hasZoom={false}
(just an example) that can be included in the below web-view
tag that can disable zooming.
It has to be working on both android and ios.
<WebView
ref={WEBVIEW_REF}
source={{uri:Environment.LOGIN_URL}}
ignoreSslError={true}
onNavigationStateChange={this._onNavigationStateChange.bind(this)}
onLoad={this.onLoad.bind(this)}
onError={this.onError.bind(this)}
></WebView>
For anyone in the future, I solved this by adding the following css :
The above basically disable text selection on all elements, which during my testing disallowed zooming on webpage. FYI: I haven't dived deep into details, just stating its effects.
Try
scalesPageToFit={false}
more info in hereThought this might help others, I solved this by adding the following in the html
<head>
section:<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0">
I was able to disable zooming, text selection and other pointer events by wrapping
WebView
in aView
and setting a few props:Put this attribute to Webview
pointerEvents="none"
, or wrap the Webview by other view with this attribute.Little hacky stuff but it works
Note initial-scale=1, maximum-scale=0.99, user-scalable=0