Skip to content

Commit e0657b8

Browse files
committed
commit added Styles property to ListItemPicker and ComboBoxListItemPicker
1 parent e778dd9 commit e0657b8

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/controls/listItemPicker/ComboBoxListItemPicker.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
4141
.then((value) => {
4242
this.setState({...this.state,
4343
safeListId: value });
44-
this.loadOptions(this.props).then(() => { /* no-op; */}).catch(() => { /* no-op; */});
44+
this.loadOptions(this.props).then(() => { /* no-op; */}).catch(() => { /* no-op; */});
4545
})
46-
.catch(() => { /* no-op; */ });
46+
.catch(() => { /* no-op; */ });
4747
} else {
4848
this.loadOptions(this.props).then(() => { /* no-op; */}).catch(() => { /* no-op; */});
4949
}
@@ -151,6 +151,7 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
151151
return (
152152
<div className={styles.comboBoxListItemPickerWrapper}>
153153
<ComboBox label={this.props.label}
154+
styles={this.props.styles}
154155
options={this.state.availableOptions}
155156
autoComplete={this.props.autoComplete}
156157
comboBoxOptionStyles={this.props.comboBoxOptionStyles}

src/controls/listItemPicker/IComboBoxListItemPickerProps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { IComboBoxOptionStyles } from "office-ui-fabric-react/lib/components/ComboBox";
1+
import { IComboBoxOptionStyles, IComboBoxStyles } from "office-ui-fabric-react/lib/components/ComboBox";
2+
23
import { IAutofillProps } from "office-ui-fabric-react/lib/components/Autofill";
34
import { IKeytipProps } from "office-ui-fabric-react/lib/components/Keytip";
45
import { SPHttpClient } from '@microsoft/sp-http';
@@ -30,4 +31,5 @@ export interface IComboBoxListItemPickerProps {
3031
onSelectedItem: (item: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
3132
label?: string;
3233
orderBy?:string;
34+
styles?: IComboBoxStyles;
3335
}

src/controls/listItemPicker/IListItemPickerProps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { IBasePickerStyles } from 'office-ui-fabric-react';
2+
13
import { BaseComponentContext } from '@microsoft/sp-component-base';
24

35
export interface IListItemPickerProps {
@@ -32,5 +34,6 @@ export interface IListItemPickerProps {
3234
* Enable default suggestions. All options are displayed by default when clicking on the control
3335
*/
3436
enableDefaultSuggestions?: boolean;
37+
styles? : IBasePickerStyles;
3538

3639
}

src/controls/listItemPicker/ListItemPicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class ListItemPicker extends React.Component<IListItemPickerProps, IListI
4848
safeListId: value });
4949
this.ensureLoadField();
5050
})
51-
.catch(() => { /* no-op; */ });
51+
.catch(() => { /* no-op; */ });
5252
} else {
5353
this.ensureLoadField();
5454
}
@@ -93,6 +93,7 @@ export class ListItemPicker extends React.Component<IListItemPickerProps, IListI
9393
}
9494
<div id={this._tagPickerId}>
9595
<TagPicker onResolveSuggestions={this.onFilterChanged}
96+
styles={this.props.styles}
9697
onEmptyResolveSuggestions={(selectLists) => {
9798
if (this.props.enableDefaultSuggestions) {
9899
return this.onFilterChanged("", selectLists);

0 commit comments

Comments
 (0)