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

Set Modal.openCount floor to 0 #1368

Merged
merged 1 commit into from Jan 18, 2019
Merged

Set Modal.openCount floor to 0 #1368

merged 1 commit into from Jan 18, 2019

Conversation

x0a
Copy link
Contributor

@x0a x0a commented Jan 18, 2019

Fixes bug described in #1279 where Modal.openCount becomes negative after multiple .destroy() calls, preventing "modal-open" from being added to document.body.

Solution is prevent Modal.openCount from going below a minimum of 0, rejecting decrements that result in an erroneous negative value.

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • 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.

Fixes bug where Modal.openCount becomes negative after multiple .destroy() calls
@TheSharpieOne TheSharpieOne merged commit 71f9574 into reactstrap:master Jan 18, 2019
juanmaguitar added a commit to juanmaguitar/reactstrap that referenced this pull request Jan 18, 2019
* 'master' of github.com:reactstrap/reactstrap: (81 commits)
  fix(Modal): set Modal.openCount floor to 0 (reactstrap#1368)
  feat(Popover): add default toggleable fade support (reactstrap#1364) (reactstrap#1364)
  chore(release): release 7.1.0
  feat(Popover): add legacy trigger, replacing isInteractive prop
  feat(Popover): backward-compatible Popover behavior (reactstrap#1360)
  Fix(Modal): don't treat clicks on Portal children as backdrop clicks (reactstrap#1359)
  feat(*): support forwardRef components as tag
  fix(NavLink): console error while using @reach/Router (reactstrap#1350)
  feat(Spinner): Add spinner component (reactstrap#1352)
  feat(Switch): Add support for CustomInput type='switch' (reactstrap#1353)
  chore(release): adding 7.0.2
  fix(npm): fix published files
  chore(release): adding 7.0.1
  fix(*): fix release artifacts (reactstrap#1345)
  chore(release): adding 7.0.0 (reactstrap#1342)
  docs(typo): Fix misspelling in documentation (Alerts) (reactstrap#1329)
  docs(Input): static input error (reactstrap#1335)
  fix lint issue
  Bug/v7 merge conflict fix (reactstrap#1324)
  feat(CardBody): add innerRef to CardBody (reactstrap#1318)
  ...
@x0a x0a deleted the Modal-openCount-fix branch January 18, 2019 17:59
@python273
Copy link

It doesn't actually fix it I think. You might have a few opened modal windows, so a few calls of destroy will lead to incorrect openCount value

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.

None yet

3 participants