Skip to content

fix(collapse/toggle): "collapsed" class cleared when component updated. fixes #1798 #2102

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

Merged
merged 2 commits into from
Oct 25, 2018
Merged

fix(collapse/toggle): "collapsed" class cleared when component updated. fixes #1798 #2102

merged 2 commits into from
Oct 25, 2018

Conversation

lianee
Copy link
Contributor

@lianee lianee commented Oct 25, 2018

fixes #1798

@codecov
Copy link

codecov bot commented Oct 25, 2018

Codecov Report

Merging #2102 into dev will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2102      +/-   ##
==========================================
+ Coverage   64.64%   64.65%   +0.01%     
==========================================
  Files         154      154              
  Lines        2913     2914       +1     
  Branches      802      802              
==========================================
+ Hits         1883     1884       +1     
  Misses        740      740              
  Partials      290      290
Impacted Files Coverage Δ
src/components/collapse/collapse.js 75.4% <100%> (+0.4%) ⬆️

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 5348d49...bbde109. Read the comment docs.

@@ -187,6 +187,9 @@ export default {
}
this.emitState()
},
updated () {
Copy link
Member

Choose a reason for hiding this comment

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

This actually runs when the component's vdom has updated, and doesn't monitor for changes outside of the component.

What might be a better approach to this, is to update the v-b-toggle directive to use the observeDom utility to monitor changes to the trigger element's attributes (shallow observer).

I will look into this.

Copy link
Member

Choose a reason for hiding this comment

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

Although just testing in the playground, this appears to work for most cases.

@tmorehouse tmorehouse changed the title fix(collapse/toggle): "collapsed" class cleared when component updated fix(collapse/toggle): "collapsed" class cleared when component updated. fixes #1798 Oct 25, 2018
@tmorehouse tmorehouse merged commit 6d33cae into bootstrap-vue:dev Oct 25, 2018
shinrox added a commit to shinrox/bootstrap-vue that referenced this pull request Oct 26, 2018
* dev: (31 commits)
  feat(card): support left and right image placement (bootstrap-vue#1981)
  fix(collapse/toggle): "collapsed" class cleared when component updated (bootstrap-vue#2102)
  fix(form-file): Add validation of single file (bootstrap-vue#2028)
  chore(docs): minor update to the b-form-input docs
  chore(docs): Minor update to b-form-input docs
  feat(table): Add row-unhovered event (bootstrap-vue#1874)
  feat(table): Support contextmenu event binding for table rows (bootstrap-vue#2064)
  docs(table): fix minor typo (bootstrap-vue#2093)
  feat(table): Support sorting on nested object properties (bootstrap-vue#1868)
  perf(modal): optimize model.resetScrollbar, resolves bootstrap-vue#1831  (bootstrap-vue#1837)
  docs: Update images reference section (bootstrap-vue#1999)
  fix(observe-dom): fix comment typo (bootstrap-vue#2084)
  chore(modal): trivial word fix in comment (bootstrap-vue#2089)
  (docs): Fix grammer in Intro readme (bootstrap-vue#2092)
  fix(modal): prevent scrolling on .modal-content focus, fixes bootstrap-vue#1748 (bootstrap-vue#2060)
  feat(pagination):  added slots for first, prev, next, last, and ellipsis. Fixes bootstrap-vue#1870. (bootstrap-vue#1980)
  Handle state change on validated fields. (bootstrap-vue#1984)
  fix(docs): input group prepend slot typo (bootstrap-vue#2059)
  fix(dependencies): replace opencollective with opencollective-postintall (bootstrap-vue#2067)
  fix(docs): change b-input-group attribute 'left' to 'prepend' (bootstrap-vue#2017)
  ...
@lianee lianee deleted the toggle-collapse-class branch October 28, 2018 13:59
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.

Collapse: collapsed class not persistent
2 participants