Skip to content

Commit

Permalink
fix(client-electron): use unique id on lists
Browse files Browse the repository at this point in the history
  • Loading branch information
marcincichocki authored Nov 11, 2021
1 parent a564c34 commit ebc232a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/electron/renderer/components/KeyBind.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const KeyBind = ({
<KeyBindText>Unbound</KeyBindText>
) : (
selected.map((key, i) => (
<Fragment key={i}>
<Fragment key={key}>
{!!i && <KeyCodeSeparator>+</KeyCodeSeparator>}
<KeyCode>{key}</KeyCode>
</Fragment>
Expand Down
9 changes: 6 additions & 3 deletions src/electron/renderer/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ const SelectViewer = ({ options, index }: SelectViewerProps) => (
<SelectViewerValue>{options[index].name}</SelectViewerValue>
<SelectViewerOptions>
{options.map((option, i) => (
<SelectViewerOption key={i} active={index === i}></SelectViewerOption>
<SelectViewerOption
key={option.name}
active={index === i}
></SelectViewerOption>
))}
</SelectViewerOptions>
</SelectViewerWrapper>
Expand Down Expand Up @@ -150,8 +153,8 @@ export const Select = ({
return (
<SelectWrapper disabled={disabled}>
<select hidden value={value} onChange={onChange}>
{options.map(({ value }, i) => (
<option key={i} value={value}></option>
{options.map(({ name, value }) => (
<option key={name} value={value}></option>
))}
</select>
<SelectButton onClick={prev} disabled={disabled}>
Expand Down

0 comments on commit ebc232a

Please sign in to comment.