select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Handle Price Filtering <form> reset events

When the “Clear Filters” button is clicked, the <form> element will return to its initial state, and a reset event will be fired.

This commit configures the <form> element to route that event to the seats#filterSeats action.

Unfortunately, this event’s currentTarget property does not refer to the <input type="radio"> button element that the value was reset to.

To account for this, handle the case when currentTarget.value is undefined as a proxy for the <form> being reset, and replace it with a value that will never be less than a price on the page (e.g. Infinity).

Desktop

price filtering form reset