audiobookshelf/client/components/ui
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
..
Btn.vue
Checkbox.vue
ContextMenuDropdown.vue
Dropdown.vue
EditableText.vue Support for libraries and folder mapping, updating static cover path, detect reader.txt 2021-10-04 22:11:42 -05:00
FileInput.vue Update:Edit modal for mobile screen sizes and update tailwind 2022-06-26 11:15:19 -05:00
IconBtn.vue Add:Notification edit/delete and UI updates #996 2022-09-24 14:03:14 -05:00
InputDropdown.vue Update:Editing series on book in edit modal sets focus to first available input #889 2022-08-03 18:38:08 -05:00
LibrariesDropdown.vue Merge pull request #1335 from lkiesow/keyboard-navigation-libraries 2022-12-28 17:18:35 -06:00
LibraryIcon.vue Update:New library icons and picker using icon font 2022-10-18 12:09:36 -05:00
LoadingIndicator.vue Add audiobook uploader 2021-09-13 20:18:58 -05:00
MediaIconPicker.vue Update:New library icons and picker using icon font 2022-10-18 12:09:36 -05:00
Menu.vue
MultiSelect.vue Fix scroll listener for multi select inputs 2022-12-19 16:10:45 -06:00
MultiSelectDropdown.vue Fix scroll listener for multi select inputs 2022-12-19 16:10:45 -06:00
MultiSelectQueryInput.vue
QueryInput.vue Fix:Edit modal dropdown menus hidden #1295 2022-12-19 15:32:17 -06:00
ReadIconBtn.vue Fix: Setting root socket error, Change: collection books table ordering and icons #151 2021-11-07 15:28:06 -06:00
RichTextEditor.vue Add:Rich text editor for podcast episode description 2022-05-28 13:36:58 -05:00
TextareaInput.vue
TextareaWithLabel.vue New data model removing media entity for books 2022-03-26 11:59:34 -05:00
TextInput.vue
TextInputWithLabel.vue Remove extra space from label 2022-12-29 18:03:05 -06:00
TimePicker.vue
ToggleSwitch.vue Toggle switch shouldn't submit form 2023-01-10 22:58:20 +01:00
Tooltip.vue
VueTrix.vue Add:Rich text editor for podcast episode description 2022-05-28 13:36:58 -05:00