Skip to content

Commit 936af86

Browse files
author
Markus Langer
committed
Show span if error is present
1 parent ccde634 commit 936af86

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/controls/listItemPicker/ComboBoxListItemPicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
9696
className={className}
9797
disabled={disabled} />
9898

99-
<Label style={{ color: '#FF0000' }}> {this.state.errorMessage} </Label>
99+
{!!this.state.errorMessage &&
100+
(<Label style={{ color: '#FF0000' }}> {this.state.errorMessage} </Label>)}
100101
</div>) : <span>Loading...</span>
101102
);
102103
}

src/controls/listItemPicker/ListItemPicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as strings from 'ControlStrings';
22
import * as React from "react";
33
import SPservice from "../../services/SPService";
4-
import { escape } from "@microsoft/sp-lodash-subset";
54
import { TagPicker } from "office-ui-fabric-react/lib/components/pickers/TagPicker/TagPicker";
65
import { Label } from "office-ui-fabric-react/lib/Label";
76
import { IListItemPickerProps, IListItemPickerState } from ".";
@@ -61,7 +60,8 @@ export class ListItemPicker extends React.Component<IListItemPickerProps, IListI
6160
placeholder: placeholder
6261
}} />
6362

64-
<Label style={{color:'#FF0000'}}> {this.state.errorMessage} </Label>
63+
{!!this.state.errorMessage &&
64+
(<Label style={{color:'#FF0000'}}> {this.state.errorMessage} </Label>)}
6565
</div>
6666
);
6767
}

0 commit comments

Comments
 (0)