Skip to content

Commit 998e04e

Browse files
authored
1.3.2 (#27)
* fix onTransitionEnd height comparison, #26 * bump 1.3.2 * up github actions node version * fix height comparison, 2 * up deps * attempt to fix github action cypress binary err * attempt to fix github action cypress binary err, 2 * update test to match firefox 124 behavior, set node to 21 to ci * fix cypress firefox >= 124 ci bug * fix cypress firefox >= 124 ci bug, 2 * remove firefox tests from ci (bugged as hell), cleanup
1 parent b243569 commit 998e04e

File tree

9 files changed

+226
-244
lines changed

9 files changed

+226
-244
lines changed

.github/workflows/chrome-tests.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: '18'
14+
node-version: 21
1515
- uses: pnpm/action-setup@v2
1616
name: Install pnpm
1717
with:
1818
version: 8
19-
run_install: true
19+
run_install: false
20+
- name: Install deps
21+
run: pnpm i
2022
- name: Install Cypress binaries
21-
run: npx cypress install
23+
run: pnpm dlx cypress install
2224
- name: Chrome tests
2325
run: pnpm test:chrome

.github/workflows/firefox-tests.yml

-23
This file was deleted.

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v3
2121
- uses: actions/setup-node@v3
2222
with:
23-
node-version: '20.x'
23+
node-version: '21.x'
2424
registry-url: 'https://registry.npmjs.org'
2525
- uses: pnpm/action-setup@v2
2626
name: Install pnpm

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"devDependencies": {
1818
"concurrently": "^8.2.2",
1919
"husky": "^8.0.3",
20-
"lint-staged": "^15.2.0",
21-
"prettier": "^3.1.0"
20+
"lint-staged": "^15.2.2",
21+
"prettier": "^3.2.5"
2222
},
2323
"lint-staged": {
2424
"*.{js,ts,vue,json,css,md}": "prettier --write"

packages/vue-collapsed/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-collapsed",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"private": false,
55
"description": "Dynamic CSS height transition from any to auto and vice versa for Vue 3. Accordion ready.",
66
"keywords": [
@@ -47,16 +47,16 @@
4747
"test:gui": "concurrently \"pnpm watch\" \"cypress open --component\""
4848
},
4949
"devDependencies": {
50-
"@types/node": "^20.8.7",
51-
"@vitejs/plugin-vue": "^4.4.0",
50+
"@types/node": "^20.12.5",
51+
"@vitejs/plugin-vue": "^4.6.2",
5252
"concurrently": "^8.2.2",
53-
"cypress": "^13.3.2",
54-
"cypress-wait-frames": "^0.9.4",
55-
"husky": "^8.0.3",
56-
"typescript": "^5.2.2",
57-
"vite": "^4.5.0",
58-
"vite-plugin-dts": "^3.6.0",
59-
"vue": "^3.3.4",
60-
"vue-tsc": "^1.8.19"
53+
"cypress": "^13.7.2",
54+
"cypress-wait-frames": "^0.9.8",
55+
"husky": "^9.0.11",
56+
"typescript": "^5.4.4",
57+
"vite": "^4.5.3",
58+
"vite-plugin-dts": "^3.8.1",
59+
"vue": "^3.3.13",
60+
"vue-tsc": "^1.8.27"
6161
}
6262
}

packages/vue-collapsed/src/Collapse.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,18 @@ watch(baseHeight, (newBaseHeight) => {
212212
// Transition events
213213
214214
function onTransitionEnd(e: TransitionEvent) {
215-
if (e.target === collapseRef.value && e.propertyName === 'height') {
215+
if (e.target && e.target === collapseRef.value && e.propertyName === 'height') {
216216
/**
217217
* Reset styles to the initial style state,
218218
* we also make sure callbacks are triggered only once
219219
* when transitions are 100% finished.
220220
*/
221221
if (isExpanded.value) {
222-
if (collapseRef.value?.scrollHeight === getComputedHeight(collapseRef)) {
222+
if (Math.abs(collapseRef.value.scrollHeight - getComputedHeight(collapseRef)) < 1) {
223223
onExpanded()
224224
}
225225
} else {
226-
if (baseHeight.value === getComputedHeight(collapseRef)) {
226+
if (Math.abs(baseHeight.value - getComputedHeight(collapseRef)) < 1) {
227227
onCollapsed()
228228
}
229229
}

packages/vue-collapsed/src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function isReducedOrDisabled(el: RefEl) {
4141

4242
return (
4343
typeof window.requestAnimationFrame === 'undefined' ||
44-
matchMedia('(prefers-reduced-motion: reduce)').matches ||
44+
window.matchMedia('(prefers-reduced-motion: reduce)').matches ||
4545
transition.includes('none') ||
4646
transition.includes('height 0s')
4747
)

0 commit comments

Comments
 (0)