question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Select] onBlur event target

See original GitHub issue

There is some mismatch with [Select] events.

<Select 
    onChange={console.log} 
    onBlur={console.log}
>
    {options}
</Select>

In this case, both events are fired, but onChange has event.target set to [Input] with appropriate attributes, but onBlur has event.target set to [Select]. Even when onBlur is set directly to [Input], event.target is still [Select].

Problem is that this makes onBlur event useless when you need handle input value onBlur in stateless components. You can’t read input value or any of attributes.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hassan-zaheercommented, Aug 10, 2018

np I can submit a fix tonight

0reactions
Mangattcommented, Aug 10, 2018

@hassan-zaheer It would be great, since I’m unavailable to work on this issue right now. And I guess that no one else is working on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When a 'blur' event occurs, how can I find out which element ...
2015 answer: according to UI Events, you can use the relatedTarget property of the event: Used to identify a secondary EventTarget related to...
Read more >
Element: blur event - Web APIs | MDN
The blur event fires when an element has lost focus. The event does not bubble, but the related focusout event that follows does...
Read more >
onblur Event - W3Schools
The onblur event occurs when an element loses focus. The onblur event is often used on input fields. The onblur event is often...
Read more >
[Select] onBlur event target #12204 - mui/material-ui - GitHub
In this case, both events are fired, but onChange has event.target set to [Input] with appropriate attributes, but onBlur has event.target ...
Read more >
.blur() | jQuery API Documentation
An object containing data that will be passed to the event handler. ... A function to execute each time the event is triggered....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found