Skip to content

Commit

Permalink
Merge pull request #3709 from rdjuric/weirdScrollBarFix
Browse files Browse the repository at this point in the history
Fix: ScrollBar staying in the middle of the modal (iOS)
  • Loading branch information
Tim Szot authored Jun 22, 2021
2 parents 3f3a97f + 1b71b70 commit d1b79b0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/components/Modal/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import React from 'react';
import {SafeAreaView} from 'react-native';
import withWindowDimensions from '../withWindowDimensions';
import BaseModal from './BaseModal';
import {propTypes, defaultProps} from './ModalPropTypes';

// Only want to use <SafeAreaView> on iOS. Avoids ScrollBar in the middle of the modal.
// https://github.com/facebook/react-native/issues/26610
const Modal = props => (
<BaseModal
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{props.children}
</BaseModal>
<SafeAreaView>
<BaseModal
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{props.children}
</BaseModal>
</SafeAreaView>

);

Modal.propTypes = propTypes;
Expand Down

0 comments on commit d1b79b0

Please sign in to comment.