|
@@ -32,7 +32,6 @@ test('@click.away with x-collapse (prevent race condition)',
|
|
|
}
|
|
|
)
|
|
|
|
|
|
-
|
|
|
test('@click.away with x-collapse and borders (prevent race condition)',
|
|
|
html`
|
|
|
<div x-data="{ show: false }">
|
|
@@ -47,3 +46,25 @@ test('@click.away with x-collapse and borders (prevent race condition)',
|
|
|
get('h1').should(haveAttribute('style', 'height: auto;'))
|
|
|
}
|
|
|
)
|
|
|
+
|
|
|
+// https://github.com/alpinejs/alpine/issues/2335
|
|
|
+test('double-click on x-collapse does not mix styles up',
|
|
|
+ [html`
|
|
|
+ <div x-data="{ expanded: false }">
|
|
|
+ <button @click="expanded = ! expanded">toggle</button>
|
|
|
+ <h1 x-show="expanded" x-collapse>contents</h1>
|
|
|
+ </div>
|
|
|
+ `],
|
|
|
+ ({ get }, reload) => {
|
|
|
+ get('h1').should(haveComputedStyle('height', '0px'))
|
|
|
+ get('h1').should(haveAttribute('style', 'height: 0px; overflow: hidden;'))
|
|
|
+ get('button').click()
|
|
|
+ get('button').click()
|
|
|
+ get('h1').should(haveAttribute('style', 'height: 0px; overflow: hidden;'))
|
|
|
+ get('button').click()
|
|
|
+ get('h1').should(haveAttribute('style', 'height: auto;'))
|
|
|
+ get('button').click()
|
|
|
+ get('button').click()
|
|
|
+ get('h1').should(haveAttribute('style', 'height: auto;'))
|
|
|
+ },
|
|
|
+)
|