From c269f65d084a3759448cfae47ac9f9781229b4a7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 15:45:38 +0800 Subject: [PATCH] Fix badge count always 0 bug in IE8/9, #605 --- components/badge/ScrollNumber.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/badge/ScrollNumber.jsx b/components/badge/ScrollNumber.jsx index ffb482a09f..279ca258dd 100644 --- a/components/badge/ScrollNumber.jsx +++ b/components/badge/ScrollNumber.jsx @@ -1,5 +1,6 @@ import React, { createElement } from 'react'; import assign from 'object-assign'; +import { isCssAnimationSupported } from 'css-animation'; function getNumberArray(num) { return num ? @@ -98,7 +99,8 @@ class AntScrollNumber extends React.Component { const props = assign({}, this.props, { className: `${this.props.prefixCls} ${this.props.className}` }); - if (typeof document !== 'undefined' && typeof window !== 'undefined') { + const isBrowser = (typeof document !== 'undefined' && typeof window !== 'undefined'); + if (isBrowser && isCssAnimationSupported) { return createElement( this.props.component, props,