()
| 155 | } |
| 156 | |
| 157 | toggleVisible() { |
| 158 | const { onEnter } = this.props; |
| 159 | const { enter, enterActive, enterTo, leaveActive, leaveTo } = this.transitionClass; |
| 160 | const childDOM = ReactDOM.findDOMNode(this.el); |
| 161 | |
| 162 | childDOM.addEventListener('transitionend', this.didEnter); |
| 163 | childDOM.addEventListener('animationend', this.didEnter); |
| 164 | |
| 165 | // this.animateElement(childDOM, enter, enterActive, this.didEnter); |
| 166 | |
| 167 | requestAnimationFrame(() => { |
| 168 | // when hidden transition not end |
| 169 | if (childDOM.classList.contains(leaveActive)) { |
| 170 | childDOM.classList.remove(leaveActive, leaveTo); |
| 171 | |
| 172 | childDOM.removeEventListener('transitionend', this.didLeave); |
| 173 | childDOM.removeEventListener('animationend', this.didLeave); |
| 174 | } |
| 175 | |
| 176 | childDOM.style.display = ''; |
| 177 | childDOM.classList.add(enter, enterActive); |
| 178 | |
| 179 | onEnter && onEnter(); |
| 180 | |
| 181 | requestAnimationFrame(() => { |
| 182 | childDOM.classList.remove(enter); |
| 183 | childDOM.classList.add(enterTo); |
| 184 | }) |
| 185 | }) |
| 186 | } |
| 187 | |
| 188 | toggleHidden() { |
| 189 | const { onLeave } = this.props; |
no test coverage detected