From 08bc7c7206c16a76eefa5eb23418b15f68fc054c Mon Sep 17 00:00:00 2001 From: "neil.zhang" Date: Sat, 4 Nov 2023 16:38:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=8A=80=E8=83=BD=E5=92=8C=E6=9C=9D?= =?UTF-8?q?=E5=90=91=E9=87=8D=E7=BD=AE=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=B2=A1=E6=9C=89=E5=88=B7=E6=96=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/action/EditorActionOperatorDirection.tsx | 5 +++-- src/components/editor/operator/EditorOperatorSkill.tsx | 6 +++--- src/components/editor/operator/EditorPerformerAdd.tsx | 9 ++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/editor/action/EditorActionOperatorDirection.tsx b/src/components/editor/action/EditorActionOperatorDirection.tsx index 98a7ed47..286715f6 100644 --- a/src/components/editor/action/EditorActionOperatorDirection.tsx +++ b/src/components/editor/action/EditorActionOperatorDirection.tsx @@ -7,7 +7,7 @@ import { SetOptional } from 'type-fest' import { EditorFieldProps } from 'components/editor/EditorFieldProps' import type { CopilotDocV1 } from 'models/copilot.schema' -import { operatorDirections } from '../../../models/operator' +import { OperatorDirection, operatorDirections } from '../../../models/operator' import { FormField2 } from '../../FormField' interface EditorActionOperatorDirectionProps @@ -41,8 +41,9 @@ export const EditorActionOperatorDirection = ({ error={errors[name]} description="部署干员的干员朝向" > - filterable={false} + resetOnSelect={true} items={operatorDirections} itemRenderer={(action, { handleClick, handleFocus, modifiers }) => ( () interface EditorOperatorSkillProps extends EditorFieldProps {} @@ -52,8 +51,9 @@ export const EditorOperatorSkill = ({ const selected = items.find((item) => item.value === (value ?? 1)) return ( - filterable={false} + resetOnSelect={true} items={items} itemRenderer={(action, { handleClick, handleFocus, modifiers }) => ( - + ) } diff --git a/src/components/editor/operator/EditorPerformerAdd.tsx b/src/components/editor/operator/EditorPerformerAdd.tsx index e008eee5..387a4a21 100644 --- a/src/components/editor/operator/EditorPerformerAdd.tsx +++ b/src/components/editor/operator/EditorPerformerAdd.tsx @@ -47,7 +47,7 @@ export const EditorPerformerAdd: FC = ({ submitOperator, submitGroup, }) => { - const activeItem = + const selectedItem = performerSelectItems.find((item) => item.value === mode) || performerSelectItems[0] @@ -59,20 +59,19 @@ export const EditorPerformerAdd: FC = ({ items={performerSelectItems} className="ml-1" onItemSelect={(e) => onModeChange(e.value)} - itemRenderer={(action, { handleClick, handleFocus, modifiers }) => ( + itemRenderer={(action, { handleClick, handleFocus }) => ( )} - activeItem={activeItem} >