Skip to content

Commit

Permalink
onclick for option established
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Leopold committed Jan 24, 2021
1 parent ac8c46c commit 803af6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/FlightForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FlightForm extends Component {
this.componentDidMount = this.componentDidMount.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleClick = this.handleClick.bind(this);
// this.handleValueChange = this.handleValueChange.bind(this);
this.handleOptionClick = this.handleOptionClick.bind(this)
this.handleCountryValueChange = this.handleCountryValueChange.bind(this)
this.handleInput = this.handleInput.bind(this)
}
Expand Down Expand Up @@ -168,6 +168,8 @@ class FlightForm extends Component {
// For normal text input
handleInput(event) {

let flightForm = this

let thisInput = event.target

if (event.target.value.length > 0) {
Expand All @@ -194,6 +196,7 @@ class FlightForm extends Component {
let portName = port.name.toLowerCase()
let option = document.createElement("OPTION")
option.value = option.innerHTML = portName
option.onclick = flightForm.handleOptionClick
newPopup.appendChild(option)
})

Expand All @@ -211,6 +214,10 @@ class FlightForm extends Component {

}

handleOptionClick(event) {
console.log(event.target)
}

render() {

return (
Expand Down

0 comments on commit 803af6d

Please sign in to comment.