mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Merge pull request #17568 from Johann-S/fixCollapseHeight
[Fix #17555][V4] fix resetting style on closing collapse
This commit is contained in:
commit
4d725c90d6
@ -235,7 +235,7 @@ const Collapse = (($) => {
|
|||||||
.trigger(Event.HIDDEN)
|
.trigger(Event.HIDDEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.style[dimension] = 0
|
this._element.style[dimension] = ''
|
||||||
|
|
||||||
if (!Util.supportsTransitionEnd()) {
|
if (!Util.supportsTransitionEnd()) {
|
||||||
complete()
|
complete()
|
||||||
|
@ -90,6 +90,21 @@ $(function () {
|
|||||||
.bootstrapCollapse('show')
|
.bootstrapCollapse('show')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
QUnit.test('should reset style to auto after finishing closing collapse', function (assert) {
|
||||||
|
assert.expect(1)
|
||||||
|
var done = assert.async()
|
||||||
|
|
||||||
|
$('<div class="collapse"/>')
|
||||||
|
.on('shown.bs.collapse', function () {
|
||||||
|
$(this).bootstrapCollapse('hide')
|
||||||
|
})
|
||||||
|
.on('hidden.bs.collapse', function () {
|
||||||
|
assert.strictEqual(this.style.height, '', 'height is auto')
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
.bootstrapCollapse('show')
|
||||||
|
})
|
||||||
|
|
||||||
QUnit.test('should remove "collapsed" class from target when collapse is shown', function (assert) {
|
QUnit.test('should remove "collapsed" class from target when collapse is shown', function (assert) {
|
||||||
assert.expect(1)
|
assert.expect(1)
|
||||||
var done = assert.async()
|
var done = assert.async()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user