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 Fix:Icon sizes 2022-11-21 07:18:10 -06:00
Checkbox.vue
ContextMenuDropdown.vue Update:Libraries table using context menu instead of hover buttons. Cleanup mobile view #1342 2023-01-07 17:14:55 -06:00
Dropdown.vue Accessibility Improvements for Main Settings 2022-12-30 19:14:04 +01:00
EditableText.vue
FileInput.vue
IconBtn.vue Add:Notification edit/delete and UI updates #996 2022-09-24 14:03:14 -05:00
InputDropdown.vue
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
MediaIconPicker.vue Update:New library icons and picker using icon font 2022-10-18 12:09:36 -05:00
Menu.vue Fix:Icon sizes 2022-11-21 07:18:10 -06:00
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 Fix:Update authors in different order #1361 2023-01-04 17:21:25 -06:00
QueryInput.vue Fix:Edit modal dropdown menus hidden #1295 2022-12-19 15:32:17 -06:00
ReadIconBtn.vue
RichTextEditor.vue
TextareaInput.vue
TextareaWithLabel.vue
TextInput.vue Make User Settings Accessible via Screen Reader 2022-12-29 05:00:40 +01:00
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 Make Tooltips Accessible 2022-11-20 20:02:31 +01:00
VueTrix.vue