1
    getPlaceholder() {
        switch (this.props.field.dataType) {
            case 'DATE':
                return 'MM/DD/YYYY'
            case 'EMAIL':
                return 'myemail@email.com'
            default:
                return null
        }
}

render() {
 return(
     <div>
        <input placeholder={field.focused ? this.getPlaceholder() : null} />
     </div>
  )
}

filed.focused is coming from redux. Returns a Boolean letting me know if field is focused or not.

this.props.field.dataType returns a string with the datatype.

I NEED to show the placeholder only on FOCUS.

This works in safari, Chrome, Firefox, and even edge. But not working in IE11.

Can anyone help?

  • 1
    This appears to be a 'feature' in IE (see this [answer](https://stackoverflow.com/questions/14445891/keep-placeholder-on-focus-in-ie10)). – Robert Farley Nov 28 '17 at 20:19

0 Answers0