Skip to content

Commit

Permalink
fix: 添加干员后,干员输入框还有干员名称
Browse files Browse the repository at this point in the history
  • Loading branch information
neil.zhang committed Nov 18, 2023
1 parent 08bc7c7 commit 896bb61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/editor/operator/EditorOperator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const EditorOperatorName = <T extends FieldValues>({
query ? fuse.search(query).map((el) => el.item) : items
}
fieldState={fieldState}
onReset={() => onChange(undefined)}
onReset={() => onChange('')}
itemRenderer={(item, { handleClick, handleFocus, modifiers }) => (
<MenuItem
key={item.name}
Expand All @@ -88,7 +88,7 @@ export const EditorOperatorName = <T extends FieldValues>({
/>
)}
onItemSelect={(item) => onChange(item.name)}
selectedItem={createArbitraryOperator(value as string)}
selectedItem={createArbitraryOperator((value || '') as string)}
inputValueRenderer={(item) => item.name}
createNewItemFromQuery={(query) => createArbitraryOperator(query)}
createNewItemRenderer={(query, active, handleClick) => (
Expand Down

0 comments on commit 896bb61

Please sign in to comment.