audiobookshelf/client/components/tables
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
..
collection Fix:Icon sizes 2022-11-21 07:18:10 -06:00
library Update:Libraries table using context menu instead of hover buttons. Cleanup mobile view #1342 2023-01-07 17:14:55 -06:00
playlist Update:Playlists for podcasts 2022-11-27 12:33:38 -06:00
podcast Add:Podcast option to quick match all unmatched episodes 2023-01-04 18:13:46 -06:00
BackupsTable.vue Update:Backups API endpoints, add get all backups route, update socket init event payload 2022-11-24 13:14:29 -06:00
ChaptersTable.vue Add:Player queue for audiobooks #1077 2022-11-12 16:48:35 -06:00
CollectionBooksTable.vue Update:More localization strings #1103 2022-11-08 17:10:08 -06:00
LibraryFilesTable.vue Update:More localization strings #1103 2022-11-07 18:27:17 -06:00
PlaylistItemsTable.vue Update:Handle edit playlist item 2022-11-27 12:17:58 -06:00
TracksTable.vue Update:More localization strings #1103 2022-11-08 08:37:39 -06:00
UploadedFilesTable.vue Update:More localization strings #1103 2022-11-07 18:27:17 -06:00
UsersTable.vue Toggle switch shouldn't submit form 2023-01-10 22:58:20 +01:00