cerebral / addressbar

Makes the addressbar of the browser work just like a normal input
MIT License
84 stars 8 forks source link

Back and forward not working after link followed #2

Closed mushishi78 closed 9 years ago

mushishi78 commented 9 years ago

I'm having an issue where the back and forward buttons are working fine unless I've followed one or more links, and then the updates the value in the browsers address bar but the change event doesn't fire.

I haven't dug into the problem yet, I might do tomorrow, but I thought I'd mention just in case you can replicate the behaviour.

christianalfoni commented 9 years ago

Hi @mushishi78 and thanks for reporting!

I tried to reproduce, but was unable to. What browser are you using? And if you have a small code snippet that will help :-)

mushishi78 commented 9 years ago

I think I had the problem both in Chrome and Firefox, but if you can't reproduce it's probably my fault then. I'll look into it myself later today, but here's the code that I'm using which was roughly taken from react-addressbar: Content Editor - LocationBar

christianalfoni commented 9 years ago

Okay, cool, let me know how it worked out and if any issues let me know and I will work with you on the example :-)

mushishi78 commented 9 years ago

Okay, I've made a simple repository to replicate the problem: react-addressbar-es6

All it is is a port of your react-addressbar with example to ES6. So the problem is somewhere between react ES6 Classes, your react-addressbar implementation and my porting.

I don't know if that means this belongs as an issue on react-addressbar, or whether it's outside your concerns, but if you could offer any insight I'd be grateful.

mushishi78 commented 9 years ago

Oh, actually nevermind. It seems to work if I bind to the change event in the constructor as opposed to the componentWillMount. I don't really know why, but that seems to work. Sorry to have bothered you. I'll close the issue.

christianalfoni commented 9 years ago

There was actually a bug here, so I have released new version :-)