Skip to content

Commit f900ebf

Browse files
fix(Autofill): Revert #33700 (#34038)
1 parent 366299d commit f900ebf

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix(Autofill): Revert #33700 to avoid breaking pickers.",
4+
"packageName": "@fluentui/react",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/react/etc/react.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class Autofill extends React_2.Component<IAutofillProps, IAutofillState>
477477
// Warning: (ae-forgotten-export) The symbol "ICursorLocation" needs to be exported by the entry point index.d.ts
478478
//
479479
// (undocumented)
480-
componentDidUpdate(_: any, previousState: IAutofillState, cursor: ICursorLocation | null): void;
480+
componentDidUpdate(_: any, _1: any, cursor: ICursorLocation | null): void;
481481
// (undocumented)
482482
componentWillUnmount(): void;
483483
// (undocumented)

packages/react/src/components/Autofill/Autofill.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class Autofill extends React.Component<IAutofillProps, IAutofillState> im
9898
return this._inputElement.current;
9999
}
100100

101-
public componentDidUpdate(_: any, previousState: IAutofillState, cursor: ICursorLocation | null) {
101+
public componentDidUpdate(_: any, _1: any, cursor: ICursorLocation | null) {
102102
const { suggestedDisplayValue, shouldSelectFullInputValueInComponentDidUpdate, preventValueSelection } = this.props;
103103
let differenceIndex = 0;
104104

@@ -114,8 +114,7 @@ export class Autofill extends React.Component<IAutofillProps, IAutofillState> im
114114
this._autoFillEnabled &&
115115
this.value &&
116116
suggestedDisplayValue &&
117-
_doesTextStartWith(suggestedDisplayValue, this.value) &&
118-
previousState.inputValue !== this.value
117+
_doesTextStartWith(suggestedDisplayValue, this.value)
119118
) {
120119
let shouldSelectFullRange = false;
121120

@@ -250,7 +249,6 @@ export class Autofill extends React.Component<IAutofillProps, IAutofillState> im
250249
if (!(ev.nativeEvent as any).isComposing) {
251250
// eslint-disable-next-line @typescript-eslint/no-deprecated
252251
switch (ev.which) {
253-
case KeyCodes.del:
254252
case KeyCodes.backspace:
255253
this._autoFillEnabled = false;
256254
break;

0 commit comments

Comments
 (0)