File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 218218 // Keep the internal `value` consistent with an outside `value` if present.
219219 // This basically allows the slider to be a controlled component.
220220 componentWillReceiveProps : function ( newProps ) {
221- var value = this . _or ( ensureArray ( newProps . value ) , this . state . value ) ;
221+ var value = this . _or ( ensureArray ( newProps . value ) , this . state . value , newProps . children ) ;
222222
223223 // ensure the array keeps the same size as `value`
224224 this . tempArray = value . slice ( ) ;
241241 // If custom handles are present but neither `value` nor `defaultValue` are applicable the handles are spread out
242242 // equally.
243243 // TODO: better name? better solution?
244- _or : function ( value , defaultValue ) {
245- var count = React . Children . count ( this . props . children ) ;
244+ _or : function ( value , defaultValue , children ) {
245+ children = children || this . props . children ;
246+ var count = React . Children . count ( children ) ;
246247 switch ( count ) {
247248 case 0 :
248249 return value . length > 0 ? value : defaultValue ;
You can’t perform that action at this time.
0 commit comments