Help! I’ve upgraded my application to Meteor v1.3 and while my code is currently a mix of React and Blaze, it seemed to all be working fine until I logged out of my application… Now I can’t login, as both of my submit events handled in the login (Blaze) Template do-not fire when I would expect them too.
Okay this is sooo weird… If I change the submit button to have a class js-submit and then change the event handler to also fire on a click .js-submit, the event is triggered on button press, just fine.
But the submit event never fires on an enter press and weirdly I don’t seem to be able to change the checked state of the checkbox; the box just shows the mouseDown grey colour and then doesn’t actually check/uncheck. If it’s loaded as checked, it stays checked, and vice-versa.
I feel like there should be no difference, since the container and mixin approach actually call the same exact code in the end. Can you try going back to the mixin for a specific component and see if that fixes the issue?
As soon as I bypass the container and swap it with the component & directly pass props, it all works fine.
I’d been using the app on 1.3 after switching fine up until I used my first React container component, lots are still loaded and working fine with the mixin.
And I can confirm if I revert the component back to it’s Mixin version, loaded in exactly the same way, I get no issues at all. It’s got to be something to do with the container!
And I can’t see anything that would cause this, so I’ll work on creating a small example app that highlights the issue… Perhaps that will help track it down.
The first React component that I ported over to using the createContainer strategy was a little “user dropdown” menu that goes up in the navbar. As such it has a toggle state for showing the dropdown, and a (slighty hacky) event handler added on componentDidMount that listens to all click events on the <body> and checks if it originated outside of the dropdown and if so, hides the dropdown. (a bit like clicking outside a modal)
In my conversion, I changed it from being a React.createClass() to a class XXX extends React.Component {} moved lots of code around and tidied things up.
In doing so I accidentally added a line… can you spot it.
Whoooooooops… that e.preventDefault() must have been a copy and paste error on my part, and effectively cancels ALL click events on the body. Oooooops.