mirror of
				https://github.com/twbs/bootstrap.git
				synced 2025-11-04 00:03:15 -05:00 
			
		
		
		
	fix resetting style on closing collapse
This commit is contained in:
		
							parent
							
								
									4ee6d99c9d
								
							
						
					
					
						commit
						32f9a5d6a5
					
				@ -235,7 +235,7 @@ const Collapse = (($) => {
 | 
			
		||||
          .trigger(Event.HIDDEN)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this._element.style[dimension] = 0
 | 
			
		||||
      this._element.style[dimension] = ''
 | 
			
		||||
 | 
			
		||||
      if (!Util.supportsTransitionEnd()) {
 | 
			
		||||
        complete()
 | 
			
		||||
 | 
			
		||||
@ -78,6 +78,21 @@ $(function () {
 | 
			
		||||
      .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) {
 | 
			
		||||
    assert.expect(1)
 | 
			
		||||
    var done = assert.async()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user