Skip to content

Commit

Permalink
Alex krasn/fix: add key prop to region icon (#540)
Browse files Browse the repository at this point in the history
* add 'key' prop for region icon to prevent error mesage

* deletes unused import
  • Loading branch information
alex-krasn committed Sep 4, 2020
1 parent b370c9a commit 87b6909
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/react/components/common/tagInput/tagInputItemLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import React, { ReactHTMLElement } from "react";
import React from "react";
import { ILabel, IFormRegion } from "../../../../models/applicationState";
import { FontIcon } from "@fluentui/react";

Expand All @@ -18,9 +18,9 @@ export default class TagInputItemLabel extends React.Component<ITagInputItemLabe
const drawnRegions = [];
const texts = [];
let hasEmptyTextValue = false;
this.props.label.value.forEach((formRegion: IFormRegion) => {
this.props.label.value.forEach((formRegion: IFormRegion, idx) => {
if (formRegion.text === "" && !hasEmptyTextValue) {
drawnRegions.push(<FontIcon className="pr-1 pl-1" iconName="RectangleShape" />)
drawnRegions.push(<FontIcon className="pr-1 pl-1" iconName="RectangleShape" key={idx}/>)
hasEmptyTextValue = true;
} else {
texts.push(formRegion.text);
Expand Down

0 comments on commit 87b6909

Please sign in to comment.