Skip to content

Commit

Permalink
moved popup removal to response handling to insure one popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Leopold committed Jan 24, 2021
1 parent a284722 commit ac8c46c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/FlightForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ class FlightForm extends Component {
handleInput(event) {

let thisInput = event.target
if (thisInput.nextSibling) {
event.target.parentNode.removeChild(thisInput.nextSibling)
}

if (event.target.value.length > 0) {
axios({
Expand All @@ -186,6 +183,10 @@ class FlightForm extends Component {

console.log(response.data.data)

while (thisInput.nextSibling) {
thisInput.parentNode.removeChild(thisInput.nextSibling)
}

let newPopup = document.createElement("DIV")
newPopup.className = "popup"

Expand Down

0 comments on commit ac8c46c

Please sign in to comment.