Skip to content

Commit

Permalink
fix: set WebView contentMode prop to "mobile"
Browse files Browse the repository at this point in the history
See #5 (comment)

updates #5
  • Loading branch information
jsamr committed Feb 19, 2021
1 parent 5e7cba7 commit 3f57d62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/webshell/etc/webshell.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface AutoheightParams<S extends WebshellProps<MinimalWebViewProps, F

// @public
export interface AutoheightState<S extends WebshellProps<MinimalWebViewProps, [ExtractFeatureFromClass<typeof HandleHTMLDimensionsFeature>]>> {
autoheightWebshellProps: Pick<S, 'webshellDebug' | 'onDOMHTMLDimensions' | 'style' | 'scalesPageToFit' | 'showsVerticalScrollIndicator' | 'disableScrollViewPanResponder'> & Partial<S>;
autoheightWebshellProps: Pick<S, 'webshellDebug' | 'onDOMHTMLDimensions' | 'style' | 'scalesPageToFit' | 'showsVerticalScrollIndicator' | 'disableScrollViewPanResponder' | 'contentMode'> & Partial<S>;
contentSize: Partial<DOMRectSize>;
resizeImplementation: HTMLDimensionsImplementation | null;
syncState: AutoheightSyncState;
Expand Down Expand Up @@ -311,6 +311,8 @@ export { makeWebshell }

// @public
export interface MinimalWebViewProps {
// (undocumented)
readonly contentMode?: unknown;
// (undocumented)
readonly disableScrollViewPanResponder?: unknown;
// (undocumented)
Expand Down
4 changes: 3 additions & 1 deletion packages/webshell/src/hooks/useAutoheight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface AutoheightState<
| 'scalesPageToFit'
| 'showsVerticalScrollIndicator'
| 'disableScrollViewPanResponder'
| 'contentMode'
> &
Partial<S>;
/**
Expand Down Expand Up @@ -323,7 +324,8 @@ export default function useAutoheight<
style: autoHeightStyle,
scalesPageToFit: false,
showsVerticalScrollIndicator: false,
disableScrollViewPanResponder: true
disableScrollViewPanResponder: true,
contentMode: 'mobile'
} as AutoheightState<S>['autoheightWebshellProps'],
resizeImplementation: implementation,
contentSize: state.contentSize,
Expand Down
1 change: 1 addition & 0 deletions packages/webshell/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export interface MinimalWebViewProps {
readonly scalesPageToFit?: unknown;
readonly showsVerticalScrollIndicator?: unknown;
readonly disableScrollViewPanResponder?: unknown;
readonly contentMode?: unknown;
}

// Web TYPES
Expand Down

0 comments on commit 3f57d62

Please sign in to comment.