Skip to content

fix missing dialog props (such as onShow) #1715

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

Merged
merged 5 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions generatedTypes/src/components/dialog/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { StyleProp, ViewStyle, ModalPropsIOS, AccessibilityProps } from 'react-native';
import { AlignmentModifiers } from '../../commons/modifiers';
import { ModalProps } from '../modal';
import { PanningDirections } from '../panningViews/panningProvider';
interface RNPartialProps extends Pick<ModalPropsIOS, 'supportedOrientations'>, Pick<AccessibilityProps, 'accessibilityLabel'> {
}
Expand Down Expand Up @@ -53,6 +54,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
9 changes: 7 additions & 2 deletions src/components/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {StyleSheet, StyleProp, ViewStyle, ModalPropsIOS, AccessibilityProps} fro
import {Colors} from '../../style';
import {AlignmentModifiers, extractAlignmentsValues} from '../../commons/modifiers';
import {Constants, 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 @@ -70,6 +70,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 @@ -246,7 +250,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 @@ -259,6 +263,7 @@ class Dialog extends Component<DialogProps, DialogState> {
onRequestClose={onBackgroundPress}
supportedOrientations={supportedOrientations}
accessibilityLabel={accessibilityLabel}
{...modalProps}
>
{this.renderDialogContainer()}
</Modal>
Expand Down