Skip to content

Commit

Permalink
Add type=button attribute to buttons
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Jun 26, 2021
1 parent 47fe34f commit da3d47a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/ActionButton/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ export default {
<li class="action" :class="{ 'action--disabled': disabled }">
<button
class="action-button"
:aria-label="ariaLabel"
:class="{ focusable: isFocusable }"
:aria-label="ariaLabel"
type="button"
@click="onClick">
<!-- @slot Manually provide icon -->
<slot name="icon">
Expand Down
5 changes: 3 additions & 2 deletions src/components/Actions/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ export default {
'action-item__menutoggle--default-icon': !iconSlotIsPopulated && defaultIcon === '',
'action-item__menutoggle--primary': primary
}"
:aria-label="ariaLabel"
aria-haspopup="true"
:aria-label="ariaLabel"
:aria-controls="randomId"
test-attr="1"
:aria-expanded="opened ? 'true' : 'false'"
test-attr="1"
type="button"
@focus="onFocus"
@blur="onBlur">
<slot v-if="iconSlotIsPopulated" name="icon" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<button
class="icon-collapse"
:class="{'icon-collapse--rotated':open}"
type="button"
@click="onClick">
<MenuDown :size="24" title="" decorative />
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppNavigationNew/AppNavigationNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<div class="app-navigation-new">
<button :id="buttonId"
:class="buttonClass"
type="button"
:disabled="disabled"
type="button"
@click="$emit('click')">
{{ text }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
v-click-outside="clickOutsideConfig"
:class="{ open }">
<div id="app-settings-header">
<button class="settings-button"
<button
class="settings-button"
type="button"
@click="toggleMenu">
{{ title }}
</button>
Expand Down
4 changes: 4 additions & 0 deletions src/components/ColorPicker/ColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default {
:style="{'background-color': color }"
class="color-picker__simple-color-circle"
:class="{ 'color-picker__simple-color-circle--active' : color === currentColor }"
type="button"
@click="pickColor(color)">
<Check v-if="color === currentColor"
:size="24"
Expand All @@ -141,18 +142,21 @@ export default {
<button
v-if="advanced"
class="color-picker__navigation-button back"
type="button"
@click="handleBack">
<ArrowLeft :size="24" title="" decorative />
</button>
<button
v-if="!advanced"
class="color-picker__navigation-button more-settings"
type="button"
@click="handleMoreSettings">
<DotsHorizontal :size="24" title="" decorative />
</button>
<button
v-if="advanced"
class="color-picker__navigation-button confirm"
type="button"
@click="handleConfirm">
{{ t('Choose') }}
</button>
Expand Down
1 change: 1 addition & 0 deletions src/components/Modal/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default {
v-tooltip.auto="playPauseTitle"
:class="{ 'play-pause-icons--paused': slideshowPaused }"
class="play-pause-icons"
type="button"
@click="togglePlayPause">
<!-- Play/pause icons -->
<Play v-if="!playing"
Expand Down
1 change: 1 addition & 0 deletions src/components/PopoverMenu/PopoverMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
class="menuitem focusable"
:class="{active: item.active}"
:disabled="item.disabled"
type="button"
@click.stop.prevent="item.action">
<span :class="item.icon" />
<p v-if="item.text && item.longtext">
Expand Down

0 comments on commit da3d47a

Please sign in to comment.