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: modal options across open modal calls #60

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Conversation

mdsiddiq-till
Copy link
Contributor

Description

Resetting modal options on every showModal call
Issue: onModalHide callback of previous modal is getting called when the next modal is hidden

Related Issues

Issue: #XXX

How Has This Been Tested

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Screenshots (if appropriate)

@@ -38,7 +38,7 @@ export const ModalProvider: React.FC<ModalProviderProps> = ({
const showModal = useCallback(
(content: React.ReactNode, options?: Partial<ModalProps>) => {
setContent(content);
if (options) optionsRef.current = options;
optionsRef.current = options;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to assign falsy values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be undefined in that case. which is fine.

@mdsiddiq-till mdsiddiq-till merged commit 531b521 into master Feb 14, 2024
1 check passed
@mdsiddiq-till mdsiddiq-till deleted the fix/modal-onhide branch February 14, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants