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): Show/Hide when once prevented #2275

Merged
merged 3 commits into from
Dec 12, 2018

Conversation

jacobmllr95
Copy link
Member

@jacobmllr95 jacobmllr95 commented Dec 12, 2018

Description of Pull Request:

#2270 broke showing/hiding of once prevented modals.
This PR fixes this.

PR checklist:

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Enhancement to an existing feature
  • ARIA accessibility
  • Documentation update
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact:

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (i.e. fixes #xxxx[,#xxxx], where "xxxx" is the issue number)
  • The PR should address only one issue or feature. If adding multiple features or fixing a bug and adding a new feature, break them into separate PRs if at all possible.
  • PR titles should following the Conventional Commits naming convention (i.e. "fix(alert): not alerting during SSR render", "docs(badge): Updated pill examples, fix typos", "chore: fix typo in docs", etc). This is very important, as the CHANGELOG is generated from these messages.

If new features/enhancement/fixes are added or changed:

  • Includes documentation updates (including updating the component's package.json for slot and event changes)
  • New/updated tests are included and passing (if required)
  • Existing test suites are passing
  • The changes have not impacted the functionality of other components or directives
  • ARIA Accessibility has been taken into consideration (does it affect screen reader users or keyboard only users? clickable items should be in the tab index, etc)

If adding a new feature, or changing the functionality of an existing feature, the PR's description above includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #2275 into dev will decrease coverage by 0.19%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev    #2275     +/-   ##
=========================================
- Coverage   66.72%   66.52%   -0.2%     
=========================================
  Files         162      162             
  Lines        3192     3167     -25     
  Branches      883      879      -4     
=========================================
- Hits         2130     2107     -23     
+ Misses        780      779      -1     
+ Partials      282      281      -1
Impacted Files Coverage Δ
src/components/modal/modal.js 57.89% <0%> (-3.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd41f3e...a1aa50b. Read the comment docs.

@jacobmllr95
Copy link
Member Author

@tmorehouse Would be nice if we could solve this quickly :)

@tmorehouse
Copy link
Member

Will just need to make sure this.is_opening/this.is_closing are falsified out on cancel of show/hide

if (showEvt.defaultPrevented || this.is_visible) {
// Don't show if canceled
this.is_opening = false
Copy link
Member

Choose a reason for hiding this comment

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

Good catch.

@tmorehouse
Copy link
Member

tmorehouse commented Dec 12, 2018

Just thinking about the root listeners added via the disable stacking PR that may be added, and as a just-in-case, remove any (with this.$root.$off('bv:modal::hidden', this.doShow)) in beforeDestroy() hook

@jacobmllr95
Copy link
Member Author

jacobmllr95 commented Dec 12, 2018

@tmorehouse Feel free to apply any changes 👍
This was just the simplest way, but there may be some edgecases.

@tmorehouse
Copy link
Member

Ok, will add the $off events in before destroy, just in case someone takes the component out of the page (I.e. route change, etc)

@tmorehouse
Copy link
Member

Added in.. any thing else before merging?

@jacobmllr95
Copy link
Member Author

No, that should be it.

getBoundingClientRects and getComputedStyle can't be tested in JSDOM environment, and just return empty strings and object values.
@tmorehouse tmorehouse merged commit 9758dfd into bootstrap-vue:dev Dec 12, 2018
@tmorehouse
Copy link
Member

tmorehouse commented Dec 12, 2018

thanks for catching this! Always handy to have someone catch all the "troy-o's"

@jacobmllr95 jacobmllr95 deleted the fix-hiding-prevented-modals branch December 12, 2018 03:37
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.

2 participants