Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> just use jQuery's focusin/focusout to make up for the lack of bubbling focus support in React

I believe the focus event bubbles just fine in React. If not, please file a bug.



It's not really a bug for the same reasons that jQuery implements focus/blur independently from focusin/focusout. focus events just don't bubble out natively so you have to make your synthetic event system do that if you want / need it. jQuery implements it as a separate pair of events, React chose not to / only deviates from DOM behavior in very few instances (onchange). Using jQuery was just easier for my use case which seemed too exotic to claim any kind of general relevance.


See a working example: http://jsfiddle.net/spicyj/3tn45/


Might be a good idea to document stuff like that ;)


Yes, React's synthetic event system is supposed to bubble for focus.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: