Error class not applying on date component


#1

I have added validation message on mobiscroll date component similar to input component.
but I dont see the error class applying to it. I see validation is working correctly. but the styling is not being applied.

the error class is also not being applied on select component.

code:
<mobiscroll.Date {…sharedProps} valid={!errorMessage} errorMessage={errorMessage && errorMessage.title}
onChange={this.handleDate.bind(this)}/>


#2

Hi there!

The mobiscroll.Date component doesn’t have a valid prop, but the mobiscroll.Input component has. You can pass the mobiscroll.Input component to the Date component to initialize on:

<mobiscroll.Date {...sharedProps} onChange={this.handleDate.bind(this)}>
  <mobiscroll.Input valid={!errorMessage} 
     errorMessage={errorMessage && errorMessage.title} />
</mobiscroll.Date>

Best,
Zoli