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

Hotfix - Add option to pass onRequestClose to ArcgisAccount #470

Merged

Conversation

LeviRemi
Copy link
Collaborator

@LeviRemi LeviRemi commented May 7, 2021

Description

  • Popover issue where onRequestClose fires immediately after opening is present when react-dom is at version 17 or later
  • The pure Popover component offers the ability to pass in a custom onRequestClose handler, but ArcgisAccount does not
  • This hotfix presents a temporary workaround wherein a custom onRequestClose can be passed into ArcgisAccount and served to the Popover

Related Issue

Related to issue #469

Motivation and Context

  • Temporary fix while a more solid fix is developed in time

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 read the CONTRIBUTING document.

- Popover issue present when react-dom is at version 17 or later
- This hotfix presents a temporary workaround
@LeviRemi LeviRemi added the bug label May 7, 2021
@LeviRemi LeviRemi requested a review from codylawson May 7, 2021 17:01
@@ -120,7 +121,7 @@ class ArcgisAccount extends Component {
/>
}
open={this.state.open}
onRequestClose={this.closeAccountControl}
onRequestClose={onRequestClose || this.closeAccountControl}
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is just a workaround, but it might be useful to pass the default close method to the custom onRequestClose. So something like:

onRequestClose={() => {
  onRequestClose ? onRequestClose(this.closeAccountControl) : this.closeAccountControl()
}

This would give you the option to still close the modal based on some custom logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea. I have updated the PR.

@LeviRemi LeviRemi merged commit 5306ed8 into develop May 7, 2021
@LeviRemi LeviRemi deleted the hotfix/add-option-to-pass-onrequestclose-to-arcgisaccount branch May 7, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants