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

fix missing dialog props (such as onShow) #1715

Merged
merged 5 commits into from
Dec 14, 2021
Merged
Changes from 3 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
9 changes: 7 additions & 2 deletions src/components/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Colors} from '../../style';
import Constants from '../../helpers/Constants';
import {AlignmentModifiers, extractAlignmentsValues} from '../../commons/modifiers';
import {asBaseComponent} from '../../commons/new';
import Modal from '../modal';
import Modal, {ModalProps} from '../modal';
import View from '../view';
import PanListenerView from '../panningViews/panListenerView';
import DialogDismissibleView from './DialogDismissibleView';
Expand Down Expand Up @@ -71,6 +71,10 @@ export interface DialogProps extends AlignmentModifiers, RNPartialProps {
* The props that will be passed to the pannable header
*/
pannableHeaderProps?: any;
/**
* Additional props for the modal.
*/
modalProps?: ModalProps;
/**
* The Dialog`s container style
*/
Expand Down Expand Up @@ -247,7 +251,7 @@ class Dialog extends Component<DialogProps, DialogState> {

render = () => {
const {modalVisibility} = this.state;
const {testID, supportedOrientations, accessibilityLabel, ignoreBackgroundPress} = this.props;
const {testID, supportedOrientations, accessibilityLabel, ignoreBackgroundPress, modalProps} = this.props;
const onBackgroundPress = !ignoreBackgroundPress ? this.hideDialogView : undefined;

return (
Expand All @@ -260,6 +264,7 @@ class Dialog extends Component<DialogProps, DialogState> {
onRequestClose={onBackgroundPress}
supportedOrientations={supportedOrientations}
accessibilityLabel={accessibilityLabel}
{...modalProps}
>
{this.renderDialogContainer()}
</Modal>
Expand Down