File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ var HTMLWebView = React.createClass({
3535 autoHeight : PropTypes . bool
3636 } ,
3737
38+ componentWillMount : function ( ) {
39+ this . onContentHeight = _ . throttle ( this . onContentHeight , 300 ) ;
40+ } ,
41+
3842 shouldComponentUpdate : function ( nextProps , nextState ) {
3943 return ! _ . isEqual ( nextProps , this . props ) || ! _ . isEqual ( nextState , this . state ) ;
4044 } ,
@@ -54,7 +58,6 @@ var HTMLWebView = React.createClass({
5458 this . _currentMakeSafe = this . props . makeSafe ;
5559 this . _safeHtml = this . safeHtml ( this . _currentHtml ) ;
5660 }
57- var updateContentHeight = _ . throttle ( this . onContentHeight , 100 ) ;
5861 return (
5962 < _HTMLWebView
6063 style = { [ { height : this . state . contentHeight } , this . props . style ] }
@@ -64,7 +67,7 @@ var HTMLWebView = React.createClass({
6467 onContentHeight = { ( e ) => {
6568 this . contentHeight = e . nativeEvent . contentHeight ;
6669 if ( this . props . autoHeight && this . contentHeight > 1 ) {
67- updateContentHeight ( ) ;
70+ this . onContentHeight ( ) ;
6871 }
6972 } } />
7073 ) ;
You can’t perform that action at this time.
0 commit comments