Currently using Rails 4 with react-rails gem and geocomplete gem.
All worked fine(ish) until I've changed the front end to use Reactjs. When I type few characters, the autocomplete list shows up. I choose the location but only the few characters are shown in my State. Example: When I type "bir", the list for "Birmingham" shows. If I select "Birmingham, United Kingdom", only "bir" gets stored, why?
js.jsx:
var NewProject = React.createClass({
mixins: [React.addons.LinkedStateMixin],
getInitialState: function() {
return {
location: this.props.data.location
}
},
render: function(){
$("#location").geocomplete({ details: "form" });
return <input type="text" id="location" valueLink={this.linkState('location')} />;
}
});
How to get the full value of the string when selected no matter if I typed in few characters?