audiobookshelf/client/components
Lars Kiesow 59ad1e5e36
Toggle switch shouldn't submit form
This patch fixes the problem that toggling one of the options in the
user account dialog will automatically submit the form.

The problem got introduced as a combination of the recent accessibility
fixes where some elements got turned into HTML button elements to make
them keyboard accessible. Doing that, I did not realize that the default
type of a button is `submit` [1]. This causes no problems at most places,
but will cause problem within a form (e.g. the user account settings)
where toggling an option is now identical to clicking submit.

This patch fixes the issue by setting the `type` attribute to `button`.
Not only for the toggle switch, but also for a few other elements which
have been recently converted to buttons.

[1] https://www.w3.org/TR/2011/WD-html5-20110525/the-button-element.html#attr-button-type
2023-01-10 22:58:20 +01:00
..
app Toggle switch shouldn't submit form 2023-01-10 22:58:20 +01:00
cards
controls Update max playback speed to 10x 2023-01-07 16:18:52 -06:00
covers
modals Update:Manual match tab prefer using ASIN with audible providers #1352 2023-01-07 16:22:59 -06:00
player
prompt
readers
stats
tables Toggle switch shouldn't submit form 2023-01-10 22:58:20 +01:00
ui Toggle switch shouldn't submit form 2023-01-10 22:58:20 +01:00
widgets Update:Handle badly formatted series sequence from Audible #1339 2023-01-07 16:33:20 -06:00