jonasschmedtmann / complete-javascript-course

Starter files, final projects, and FAQ for my Complete JavaScript course
https://www.udemy.com/the-complete-javascript-course/?couponCode=C3GITHUB10
15.69k stars 16.81k forks source link

A bug in Mapty project #406

Open AmirhosseinHashemi opened 11 months ago

AmirhosseinHashemi commented 11 months ago

First of all thanks for this fantastic course ♥.

For submit form when type is cycling we need elevation input, but when type is cycling and page reload, type is cycling and we have cadence input which is incorrect.

Screenshot (25)

I added last three line code to fix problem. It is my solution :

  _showForm(mapE) {
    // receive and store data about coords that user clicked
    this.#mapEvent = mapE;

    form.classList.remove('hidden');
    inputDistance.focus();

    // reset inputs to initial value 
    inputCadence.closest('.form__row').classList.remove('form__row--hidden');
    inputElevation.closest('.form__row').classList.add('form__row--hidden');
    inputType.value = 'running';
  }