Closed griffobeid closed 6 years ago
Hi, I'd like to work on this (:
For sure, @adiconstante. Thanks!
Here's what I have for this fix but there are two issues.
Field loses focus after the first onChange so state only stores the last letter entered
constructor(props){ super(props); this.state = {value: ''}; this.handleChange = this.handleChange.bind(this); } handleChange(event){ this.setState({value: event.target.value}); return; }
@adiconstante Did you set the value of the form field to what is in the state? Check this link out for help: https://reactjs.org/docs/forms.html
I did. I have it like so
<Field name="search" placeholder="Search by Tx Hash / Block # / Address" component="input" type="text" onChange={this.handleChange} value={this.state.value} />
@adiconstante it is a bit hard to help you solve this without seeing the entire code. Can you either place the entire code you added in a gist, or send a pull request (being very clear in the description that it isn't ready to be merged yet) @griffobeid Any other suggestions?
Looking into this now
Are we set on using redux-form here, @TalAter? I fixed the problem by changing it to a basic input like so:
<input name="search" type="text" placeholder="Search by Tx Hash / Block # / Address" onChange={this.handleChange} value={this.state.value} />
@griffobeid I'm ok with getting rid of redux-form completely (including in package.json)
Created PR with a partial fix.
@adiconstante I think it would be better to remove the dependency and switch to a basic input.
Sounds good. Please send a PR with both changes
Thank you for your help ❤️
What is this project?
DAV (Decentralized Autonomous Vehicles) is a new non-profit foundation working to build an open-source infrastructure for autonomous vehicles (cars, drones, trucks, robots, and all the service providers around them) to communicate and transact with each other over blockchain.
As an organization that believes in building a large community of open-source contributors, we often create issues like this one to help people take their first few steps into the world of open source.
Xplore
The DAV project you are looking at is Xplore. Xplore is a blockchain explorer you can run on your machine to explore local Ethereum nodes on your machine. It is used by developers working with DAV's libraries to ease development and see how the blockchain is affected by their work.
How you can help
The Issue
Currently, the search form at the top of the page is not functional. When attempting to type something in no text appears. To fix this issue modify the
Field
attribute inSearchForm.jsx
so that it can accept input and the input is stored in the local state of the component.Contributing to Xplore
Asking for help
We appreciate your effort in taking the time to work on this issue and help out the open source community and the foundation. If you need any help, feel free to ask below or in our gitter channel. We are always happy to help 😄