Skip to content

Commit

Permalink
fix(NcCheckboxRadioSwitch): fix shift+click on firefox
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Dec 27, 2023
1 parent 7d1831a commit 218637b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
-->

<template>
<component :is="wrapperElement"
:for="!isButtonType ? id : null"
<span :id="!isButtonType ? id : null"
class="checkbox-content"
:class="{
['checkbox-content-' + type]: true,
Expand Down Expand Up @@ -52,7 +51,7 @@
<!-- @slot The checkbox/radio label -->
<slot />
</span>
</component>
</span>
</template>

<script>
Expand Down Expand Up @@ -166,13 +165,6 @@ export default {
return this.type === TYPE_BUTTON
},
wrapperElement() {
if (this.isButtonType) {
return 'span'
}
return 'label'
},
/**
* Returns the proper Material icon depending on the select case
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default {
:type="isButtonType ? 'button' : null"
v-on="isButtonType ? listeners : null">
<input v-if="!isButtonType"
:id="id"
:aria-labelledby="!isButtonType ? id : null"
:aria-label="ariaLabel || undefined"
class="checkbox-radio-switch__input"
:disabled="disabled"
Expand All @@ -293,7 +293,8 @@ export default {
:button-variant="buttonVariant"
:is-checked="isChecked"
:loading="loading"
:size="size">
:size="size"
@click.native="onToggle">
<template #icon>
<!-- @slot The checkbox/radio icon, you can use it for adding an icon to the button variant -->
<slot name="icon" />
Expand Down

0 comments on commit 218637b

Please sign in to comment.