Skip to content

Commit

Permalink
Merge pull request #4488 from nextcloud-libraries/fix/checkbox-radio-…
Browse files Browse the repository at this point in the history
…switch
  • Loading branch information
skjnldsv committed Aug 31, 2023
2 parents a53da1e + 6949047 commit 1a4caa1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue
Expand Up @@ -414,6 +414,14 @@ export default {
default: false,
},
/**
* Required state
*/
required: {
type: Boolean,
default: false,
},
/**
* Loading state
*/
Expand Down Expand Up @@ -441,6 +449,7 @@ export default {
return {
checked: this.isChecked,
indeterminate: this.indeterminate,
required: this.required,
name: this.name,
}
},
Expand Down Expand Up @@ -609,13 +618,16 @@ export default {
<style lang="scss" scoped>
.checkbox-radio-switch {
display: flex;
align-items: center;
&__input {
position: absolute;
z-index: -1;
opacity: 0 !important; // We need !important, or it gets overwritten by server style
width: var(--icon-size);
height: var(--icon-size);
// Same as label padding
margin: 4px $icon-margin;
}
&__input:focus-visible + label {
Expand Down

0 comments on commit 1a4caa1

Please sign in to comment.