Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: use trigger slot for project label color picker (#19628)

boojack19764bfae8e2
diff --git a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
index 2e8525a362..87442cb077 100644
--- a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
@@ -263,7 +263,7 @@ import {
NTag,
NTooltip,
} from "naive-ui";
-import { computed, reactive, ref } from "vue";
+import { type ComponentPublicInstance, computed, reactive, ref } from "vue";
import { Switch } from "@/components/v2";
import { useProjectV1Store } from "@/store";
import type {
@@ -384,21 +384,30 @@ const renderLabel = (value: string, index: number) => {
}}
>
<div class="flex flex-row items-start justify-center gap-x-2">
- <div class="w-4 h-4 relative">
- <NColorPicker
- class="w-full! h-full!"
- modes={["hex"]}
- showAlpha={false}
- value={label.color}
- renderLabel={() => (
+ <NColorPicker
+ modes={["hex"]}
+ showAlpha={false}
+ value={label.color}
+ onUpdateValue={(color: string) => (label.color = color)}
+ v-slots={{
+ trigger: ({
+ value,
+ onClick,
+ ref: triggerRef,
+ }: {
+ value: string | null;
+ onClick: () => void;
+ ref: (el: Element | ComponentPublicInstance | null) => void;
+ }) => (
<div
- class="w-4 h-4 rounded-sm cursor-pointer relative"
- style={{ backgroundColor: label.color }}
+ ref={triggerRef}
+ class="w-4 h-4 rounded-sm cursor-pointer"
+ style={{ backgroundColor: value || label.color }}
+ onClick={onClick}
/>
- )}
- onUpdateValue={(color: string) => (label.color = color)}
- />
- </div>
+ ),
+ }}
+ />
<span>{label.value}</span>
</div>
</NTag>