Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcCheckboxRadioSwitch): fix shift+click on firefox #4999

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
-->

<template>
<component :is="wrapperElement"
:for="!isButtonType ? id : null"
<!--
label can't be used here because of shift+click firefox bug
https://bugzilla.mozilla.org/show_bug.cgi?id=559506
-->
<span :id="!isButtonType ? `${id}-label` : null"
class="checkbox-content"
:class="{
['checkbox-content-' + type]: true,
Expand Down Expand Up @@ -52,7 +55,7 @@
<!-- @slot The checkbox/radio label -->
<slot />
</span>
</component>
</span>
</template>

<script>
Expand Down Expand Up @@ -166,13 +169,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 @@ -277,6 +277,7 @@ export default {
v-on="isButtonType ? listeners : null">
<input v-if="!isButtonType"
:id="id"
:aria-labelledby="!isButtonType && !ariaLabel ? `${id}-label` : null"
:aria-label="ariaLabel || undefined"
class="checkbox-radio-switch__input"
:disabled="disabled"
Expand All @@ -293,7 +294,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
Loading