Skip to content

Commit

Permalink
Fixed EuiResizeObserver infinite disconnect call chain; fixed default…
Browse files Browse the repository at this point in the history
…Props setup in EuiComboBox
  • Loading branch information
chandlerprall committed Mar 26, 2020
1 parent a4eecae commit 953ea47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ exports[`props singleSelection is rendered 1`] = `
role="combobox"
>
<EuiComboBoxInput
append={null}
autoSizeInputRef={[Function]}
compressed={false}
fullWidth={false}
Expand All @@ -396,7 +395,6 @@ exports[`props singleSelection is rendered 1`] = `
onFocus={[Function]}
onOpenListClick={[Function]}
onRemoveOption={[Function]}
prepend={null}
rootId={[Function]}
searchValue=""
selectedOptions={
Expand Down Expand Up @@ -552,7 +550,6 @@ exports[`props singleSelection selects existing option when opened 1`] = `
role="combobox"
>
<EuiComboBoxInput
append={null}
autoSizeInputRef={[Function]}
compressed={false}
fullWidth={false}
Expand All @@ -567,7 +564,6 @@ exports[`props singleSelection selects existing option when opened 1`] = `
onFocus={[Function]}
onOpenListClick={[Function]}
onRemoveOption={[Function]}
prepend={null}
rootId={[Function]}
searchValue=""
selectedOptions={
Expand Down
8 changes: 4 additions & 4 deletions src/components/combo_box/combo_box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ interface _EuiComboBoxProps<T>
* `startsWith`: moves items that start with search value to top of the list;
* `none`: don't change the sort order of initial object
*/
sortMatchesBy?: 'none' | 'startsWith';
sortMatchesBy: 'none' | 'startsWith';
/**
* Creates an input group with element(s) coming before input. It won't show if `singleSelection` is set to `false`.
* `string` | `ReactElement` or an array of these
Expand Down Expand Up @@ -178,9 +178,9 @@ export class EuiComboBox<T> extends Component<
options: [],
selectedOptions: [],
singleSelection: false,
prepend: null,
append: null,
sortMatchesBy: 'none',
prepend: undefined,
append: undefined,
sortMatchesBy: 'none' as const,
};

state: EuiComboBoxState<T> = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/observer/resize_observer/resize_observer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const makeCompatibleObserver = (node: Element, callback: () => void) => {

window.addEventListener('resize', callback);

const _disconnect = observer.disconnect.bind(observer);
observer.disconnect = () => {
observer.disconnect();

_disconnect();
window.removeEventListener('resize', callback);
};

Expand Down

0 comments on commit 953ea47

Please sign in to comment.