Skip to content

Commit 5cd85e1

Browse files
committed
merge with dev and updates
2 parents 3a96e7b + 4f556ac commit 5cd85e1

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

src/controls/iconPicker/IconPicker.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
.dialog {
44
max-width: 600px;
5+
width: 600px;
56
}
67

78
.dialogSelectedIcons {
@@ -15,6 +16,7 @@
1516
padding: 5px;
1617
overflow: auto;
1718
max-height: 600px;
19+
height: 600px;
1820
}
1921

2022
.dialogFooter {

src/controls/iconPicker/IconPicker.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ import styles from './IconPicker.module.scss';
88
import * as strings from 'ControlStrings';
99
import { IconNames } from './IconNames';
1010
import { Panel, PanelType, IPanelProps } from 'office-ui-fabric-react/lib/Panel';
11-
import { debounce } from 'lodash';
11+
import debounce = require('lodash/debounce');
1212
import { IIconPickerState } from './IIconPickerState';
1313
import * as telemetry from '../../common/telemetry';
1414
import { Dialog, DialogType, DialogFooter } from 'office-ui-fabric-react/lib/Dialog';
1515
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
1616

17-
initializeIcons();
18-
1917
export class IconPicker extends React.Component<IIconPickerProps, IIconPickerState> {
2018
private radioIdBase: string = getId("radio");
2119

2220

2321
constructor(props: IIconPickerProps) {
2422
super(props);
2523

24+
initializeIcons();
25+
2626
telemetry.track('IconPicker');
2727

2828
this.state = {
@@ -83,8 +83,8 @@ export class IconPicker extends React.Component<IIconPickerProps, IIconPickerSta
8383
<SearchBox className={styles.searchBox}
8484
onAbort={this.onAbort}
8585
data-automation-id={`icon-picker-search`}
86-
87-
onChange={this.onChange} />
86+
onSearch={debounce(this.onChange, 300)}
87+
onChange={debounce(this.onChange, 300)} />
8888
<div className={styles.dialogIconsContainer}>
8989
{this.renderPanelContent()}
9090
</div>
@@ -158,8 +158,8 @@ export class IconPicker extends React.Component<IIconPickerProps, IIconPickerSta
158158
<SearchBox className={styles.searchBox}
159159
onAbort={this.onAbort}
160160
data-automation-id={`icon-picker-search`}
161-
162-
onChange={this.onChange} />
161+
onSearch={debounce(this.onChange, 300)}
162+
onChange={debounce(this.onChange, 300)} />
163163
<div className={styles.closeBtnContainer}>{defaultRender!(props)}</div>
164164
</div>;
165165
}

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { Link } from 'office-ui-fabric-react/lib/components/Link';
3636
import { Carousel, CarouselButtonsLocation, CarouselButtonsDisplay } from '../../../controls/carousel';
3737
import { TimeDisplayControlType } from '../../../controls/dateTimePicker/TimeDisplayControlType';
3838
import { GridLayout } from '../../../GridLayout';
39-
import { ComboBoxListItemPicker } from '../../../';
39+
import { ComboBoxListItemPicker } from '../../../controls/listItemPicker/ComboBoxListItemPicker';
4040
import { TreeView, ITreeItem, TreeItemActionsDisplayMode, TreeViewSelectionMode } from '../../../controls/treeView';
4141
import { IIconProps } from 'office-ui-fabric-react/lib/Icon';
4242
import { IconPicker } from '../../../controls/iconPicker';
@@ -1044,6 +1044,10 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
10441044
onRenderGridItem={(item: any, finalSize: ISize, isCompact: boolean) => this._onRenderGridItem(item, finalSize, isCompact)}
10451045
/>
10461046

1047+
<IconPicker buttonLabel={'Icon'}
1048+
onChange={(iconName: string) => { console.log(iconName); }}
1049+
onSave={(iconName: string) => { console.log(iconName); }} />
1050+
10471051
<div>
10481052
<FolderExplorer
10491053
context={this.props.context}

0 commit comments

Comments
 (0)