feat: Fix checkbox line height and make checkbox label clickable (#4818)

* fix: Update checkbox design and make checkbox label clickable

* fix: Remove checkbox ids

* chore: remove unused imports
This commit is contained in:
Alex Grozav
2022-12-05 14:48:56 +02:00
committed by GitHub
parent af6ac42aa3
commit 1b7952a516
2 changed files with 21 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
<template>
<el-checkbox
v-bind="$props"
ref="checkbox"
:class="['n8n-checkbox', $style.n8nCheckbox]"
:disabled="disabled"
:indeterminate="indeterminate"
@@ -12,7 +13,8 @@
:tooltipText="tooltipText"
:bold="false"
:size="labelSize"
></n8n-input-label>
@click.prevent="onLabelClick"
/>
</el-checkbox>
</template>
@@ -58,6 +60,14 @@ export default Vue.extend({
onChange(event: Event) {
this.$emit('input', event);
},
onLabelClick() {
const checkboxComponent = this.$refs.checkbox as ElCheckbox;
if (!checkboxComponent) {
return;
}
(checkboxComponent.$el as HTMLElement).click();
},
},
});
</script>
@@ -70,5 +80,9 @@ export default Vue.extend({
span {
white-space: normal;
}
label {
cursor: pointer;
}
}
</style>