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

Revert "replace onModalHide with onDismiss for the web" #15563

Merged
merged 1 commit into from
Feb 28, 2023
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
7 changes: 1 addition & 6 deletions src/components/Modal/BaseModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ const propTypes = {

/** The ref to the modal container */
forwardedRef: PropTypes.func,

/** Ensure that callback and trap deactivation are in the same loop on the web platform */
shouldUseOnDismiss: PropTypes.bool,
};

const defaultProps = {
...modalDefaultProps,
forwardedRef: () => {},
shouldUseOnDismiss: false,
};

class BaseModal extends PureComponent {
Expand Down Expand Up @@ -113,8 +109,7 @@ class BaseModal extends PureComponent {
this.props.onModalShow();
}}
propagateSwipe={this.props.propagateSwipe}
onDismiss={this.props.shouldUseOnDismiss ? this.hideModal : () => {}}
onModalHide={!this.props.shouldUseOnDismiss ? this.hideModal : () => {}}
onModalHide={this.hideModal}
onSwipeComplete={this.props.onClose}
swipeDirection={swipeDirection}
isVisible={this.props.isVisible}
Expand Down
1 change: 0 additions & 1 deletion src/components/Modal/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const Modal = (props) => {
<BaseModal
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
shouldUseOnDismiss={props.fullscreen}
onModalHide={hideModal}
onModalShow={showModal}
>
Expand Down