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

Android WebView doesn't show when set style={{ width: ... }} #88

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions autoHeightWebView/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export default class AutoHeightWebView extends PureComponent {
const { height: oldHeight, width: oldWidth, source: prevSource, script: prevScript } = state;
const { style } = props;
const { source, script } = getUpdatedState(props, getBaseScript);
const height = style ? style.height : null;
const width = style ? style.width : null;
const height = style && style.height ? style.height : null;
const width = style && style.width ? style.width : null;
if (source.html !== prevSource.html || source.uri !== prevSource.uri || script !== prevScript) {
return {
source,
Expand All @@ -133,8 +133,8 @@ export default class AutoHeightWebView extends PureComponent {
}
if (isSizeChanged(height, oldHeight, width, oldWidth)) {
return {
height,
width,
height: height ? height : oldHeight,
width: width ? width : oldWidth,
isSizeChanged: true
};
}
Expand Down