Setting onBlur event on a select TextField I expect the triggered onBlur event.target to be the TextField.
It is the selected option (or MenuItem) element.
I'm abstracting away form validation and submission. I use both onChange and onBlur event.target to get the value and name attributes of that element. Since onBlur event.target name is now undefined I get it from the props.
| Tech | Version |
|--------------|---------|
| Material-UI | beta35 |
| React | 16.2.0 |
| browser | Chrome 64 |
@galki Do you have a live reproduction example?
I expect the triggered onBlur event.target to be the TextField.
@galki Please mind the difference between event.target and event.currentTarget:
target is whatever you actually clicked on. It can vary, as this can be within an element that the event was bound to.currentTarget is the element you actually bound the event to. This will never change.
Most helpful comment
@galki Please mind the difference between
event.targetandevent.currentTarget:targetis whatever you actually clicked on. It can vary, as this can be within an element that the event was bound to.currentTargetis the element you actually bound the event to. This will never change.