Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox: Fix React.StrictMode issues #14719

Merged
merged 29 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b068d09
Migrate ComboBox to react-next
MLoughry Aug 14, 2020
1e9559f
Change files
MLoughry Aug 14, 2020
e54ea7d
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Aug 17, 2020
421e484
Migrate ComboBoxOptionWrapper
MLoughry Aug 17, 2020
e492cfa
Add stub function component
MLoughry Aug 17, 2020
86c3246
Disable tests that fail to compile for now
MLoughry Aug 17, 2020
ad33d91
Hoist default props
MLoughry Aug 17, 2020
ea9bc2c
Finalize partial migration
MLoughry Aug 17, 2020
159deef
Test fixes in progress
MLoughry Aug 18, 2020
39a549a
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Aug 18, 2020
97b3589
Fix most tests
MLoughry Aug 21, 2020
b52bd7d
Cleanup tests
MLoughry Aug 21, 2020
e817157
Fix more test cases
MLoughry Aug 24, 2020
64a2134
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Aug 24, 2020
3df6db8
Change files
MLoughry Aug 24, 2020
f75e38d
Fix build
MLoughry Aug 24, 2020
b77fc3c
Revert unintended changes
MLoughry Aug 24, 2020
b92ea90
Revert unintended change
MLoughry Aug 24, 2020
699fcf8
Fix lint error
MLoughry Aug 24, 2020
f04b1ea
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 1, 2020
373cb0d
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 1, 2020
bf3a996
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 9, 2020
aa219e4
Address feedback
MLoughry Sep 9, 2020
1ff365c
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 9, 2020
3dc82b4
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 10, 2020
b148058
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 11, 2020
0d59c52
Merge branch 'master' of github.com:microsoft/fluentui into v8/combobox
MLoughry Sep 11, 2020
fb61485
Merge branch 'master' into v8/combobox
ecraig12345 Sep 16, 2020
a7691e3
Update ref types
ecraig12345 Sep 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Fix React StrictMode issues in ComboBox",
"packageName": "@fluentui/react-next",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-08-24T16:36:56.862Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minor",
"comment": "Add the ability to specify reder options to safeCreate",
"packageName": "@uifabric/test-utilities",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-08-24T16:37:17.432Z"
}
27 changes: 2 additions & 25 deletions packages/react-next/etc/react-next.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,7 @@ export const ColorPickerGridCell: React.FunctionComponent<IColorPickerGridCellPr
export const ColorPickerGridCellBase: React.FunctionComponent<IColorPickerGridCellProps>;

// @public (undocumented)
export class ComboBox extends React.Component<IComboBoxProps, IComboBoxState> {
constructor(props: IComboBoxProps);
// (undocumented)
componentDidMount(): void;
// (undocumented)
componentDidUpdate(prevProps: IComboBoxProps, prevState: IComboBoxState): void;
// (undocumented)
componentWillUnmount(): void;
// (undocumented)
static defaultProps: IComboBoxProps;
dismissMenu: () => void;
// Warning: (ae-unresolved-inheritdoc-base) The @inheritDoc tag needs a TSDoc declaration reference; signature matching is not supported yet
//
// (undocumented)
focus: (shouldOpenOnFocus?: boolean | undefined, useFocusAsync?: boolean | undefined) => void;
// (undocumented)
render(): JSX.Element;
readonly selectedOptions: IComboBoxOption[];
// (undocumented)
UNSAFE_componentWillReceiveProps(newProps: IComboBoxProps): void;
}
export const ComboBox: React.FunctionComponent<IComboBoxProps>;

// @public
export const ContextualMenu: React.FunctionComponent<IContextualMenuProps>;
Expand Down Expand Up @@ -698,7 +678,7 @@ export interface IComboBoxOptionStyles extends IButtonStyles {
}

// @public (undocumented)
export interface IComboBoxProps extends ISelectableDroppableTextProps<IComboBox, IComboBox> {
export interface IComboBoxProps extends ISelectableDroppableTextProps<IComboBox, IComboBox>, React.RefAttributes<HTMLDivElement> {
allowFreeform?: boolean;
ariaDescribedBy?: string;
autoComplete?: 'on' | 'off';
Expand Down Expand Up @@ -738,14 +718,11 @@ export interface IComboBoxProps extends ISelectableDroppableTextProps<IComboBox,

// @public (undocumented)
export interface IComboBoxState {
currentOptions: IComboBoxOption[];
currentPendingValue?: string;
currentPendingValueValidIndex: number;
currentPendingValueValidIndexOnHover: number;
focusState?: 'none' | 'focused' | 'focusing';
isOpen?: boolean;
selectedIndices?: number[];
suggestedDisplayValue?: string;
}

// @public (undocumented)
Expand Down
8 changes: 4 additions & 4 deletions packages/react-next/src/common/testUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import * as ReactDOM from 'react-dom';
import * as ReactTestUtils from 'react-dom/test-utils';

/* eslint-disable @typescript-eslint/no-explicit-any */
export function findNodes(wrapper: ReactWrapper<any, any>, className: string): ReactWrapper<any, any> {
export function findNodes(wrapper: ReactWrapper<any, any, unknown>, className: string): ReactWrapper<any, any> {
return wrapper.find(className).filterWhere((node: ReactWrapper<any, any>) => typeof node.type() === 'string');
}

export function expectNodes(wrapper: ReactWrapper<any, any>, className: string, n: number): void {
export function expectNodes(wrapper: ReactWrapper<any, any, unknown>, className: string, n: number): void {
expect(findNodes(wrapper, className).length).toEqual(n);
}

export function expectOne(wrapper: ReactWrapper<any, any>, className: string): void {
export function expectOne(wrapper: ReactWrapper<any, any, unknown>, className: string): void {
expectNodes(wrapper, className, 1);
}

export function expectMissing(wrapper: ReactWrapper<any, any>, className: string): void {
export function expectMissing(wrapper: ReactWrapper<any, any, unknown>, className: string): void {
expectNodes(wrapper, className, 0);
}
/* eslint-enable @typescript-eslint/no-explicit-any */
Expand Down
Loading