Skip to content

Commit eb200a8

Browse files
committed
Refactor computed transitions
Closes #231
1 parent 66f44ab commit eb200a8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## Unreleased
4+
5+
### Fixed
6+
7+
- Default transition values of `none` are now correctly ignored. [#231](https://github.com/scrollreveal/scrollreveal/issues/231)
8+
9+
### Fixed
10+
311
## [4.0.5] - 2018-10-20
412

513
### Fixed

src/instance/functions/style.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,13 @@ export default function style(element) {
171171
}
172172

173173
/**
174-
* The default computed transition property should be one of:
175-
* undefined || '' || 'all 0s ease 0s' || 'all 0s 0s cubic-bezier()'
174+
* The default computed transition property should be undefined, or one of:
175+
* '' || 'none 0s ease 0s' || 'all 0s ease 0s' || 'all 0s 0s cubic-bezier()'
176176
*/
177-
if (transition.computed && !transition.computed.match(/all 0s/)) {
177+
let hasCustomTransition =
178+
transition.computed && !transition.computed.match(/all 0s|none 0s/)
179+
180+
if (hasCustomTransition) {
178181
transition.fragments.unshift({
179182
delayed: transition.computed,
180183
instant: transition.computed

0 commit comments

Comments
 (0)