diff --git a/packages/extension/src/components/option/editor/UserStyleList.tsx b/packages/extension/src/components/option/editor/UserStyleList.tsx index 26963f4c..7da74293 100644 --- a/packages/extension/src/components/option/editor/UserStyleList.tsx +++ b/packages/extension/src/components/option/editor/UserStyleList.tsx @@ -150,38 +150,43 @@ export const UserStyleList = ({ control }: UserStyleListProps) => { {array.fields .filter((f) => isEditable(f.name)) .filter((f) => isValidStyle(f.name)) - .map((field, index) => ( -
  • -

    - - {t( - `userStyles_option_${hyphen2Underscore(field.name)}`, - )} - - - {field.value} - -

    -
    - { - editorRef.current = field - setDialogOpen(true) - }} - /> - array.remove(index)} - /> -
    -
  • - ))} + .map((field, filteredIndex) => { + const originalIndex = array.fields.findIndex( + (f) => f._id === field._id, + ) + if (originalIndex === -1) return null + const fieldLabel = t( + `userStyles_option_${hyphen2Underscore(field.name)}`, + ) + return ( +
  • +

    + {fieldLabel} + + {field.value} + +

    +
    + { + editorRef.current = field + setDialogOpen(true) + }} + /> + array.remove(originalIndex)} + /> +
    +
  • + ) + })}