Skip to content

Commit 000e072

Browse files
author
Greg Guiver
authored
Merge pull request #1 from Greg-mso/UniqueSearch
Unique search
2 parents ec30783 + e069bf4 commit 000e072

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/js/components/FipIconContainer.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,15 @@ class FipIconContainer extends React.PureComponent {
119119

120120
iconSet.forEach((value, index) => {
121121
if (fuzzySearch(searchString, currentSearchSet[index])) {
122-
nIconSet.push(value);
123-
nSearchSet.push(currentSearchSet[index]);
122+
if (!nIconSet.includes(value)) {
123+
nIconSet.push(value);
124+
}
125+
if (!nSearchSet.includes(currentSearchSet[index])) {
126+
nSearchSet.push(currentSearchSet[index]);
127+
}
124128
}
125129
});
130+
126131
return {
127132
activeIcons: nIconSet,
128133
activeTitles: nSearchSet,

src/js/components/FontIconPicker.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,20 @@ class FontIconPicker extends React.PureComponent {
225225
this.closeDropdown();
226226
}
227227
};
228-
isClickWithin = /* istanbul ignore next */ target =>
229-
this.fipButtonRef.current.contains(target) ||
230-
(this.fipDropDownRef.current &&
231-
this.fipDropDownRef.current.contains(target));
228+
isClickWithin = /* istanbul ignore next */ target => {
229+
if (
230+
target.className === 'fipicon-angle-left' ||
231+
target.className === 'fipicon-angle-right' ||
232+
target.className === 'rfipicons__label'
233+
) {
234+
return true;
235+
}
236+
return (
237+
this.fipButtonRef.current.contains(target) ||
238+
(this.fipDropDownRef.current &&
239+
this.fipDropDownRef.current.contains(target))
240+
);
241+
};
232242

233243
/**
234244
* Handle the dropdown open thingy.

0 commit comments

Comments
 (0)