File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,18 @@ Perhaps use a polyfill like: https://cdn.polyfill.io/v2/polyfill.js?features=Int
72
72
}
73
73
74
74
const toggleClassBehavior =
75
- ( classNameInView || classNameAboveView ) && toggleClassNameOnInView
75
+ ( typeof classNameInView === 'string' ||
76
+ typeof classNameAboveView === 'string' ) &&
77
+ toggleClassNameOnInView
76
78
const tooglePropsBehavior = childPropsInView && toggleChildPropsOnInView
77
79
const toggleOnInViewBehavior = ( onInView || onNotInView ) && repeatOnInView
78
80
const toggleBehavior =
79
81
toggleClassBehavior || tooglePropsBehavior || toggleOnInViewBehavior
80
82
81
83
if ( nowInView && ! toggleBehavior ) {
82
84
const changes = { }
83
- if ( classNameInView ) changes . className = classNameInView
85
+ if ( typeof classNameInView === 'string' )
86
+ changes . className = classNameInView
84
87
if ( childPropsInView ) changes . childProps = childPropsInView
85
88
if ( Object . keys ( changes ) . length ) {
86
89
this . setState ( changes )
@@ -98,7 +101,7 @@ Perhaps use a polyfill like: https://cdn.polyfill.io/v2/polyfill.js?features=Int
98
101
99
102
if ( toggleBehavior ) {
100
103
// Check if we scrolled past view
101
- if ( classNameAboveView ) {
104
+ if ( typeof classNameAboveView === 'string' ) {
102
105
if (
103
106
// we just left the view
104
107
! nowInView &&
You can’t perform that action at this time.
0 commit comments