Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions common/changes/textfield-IE10issue_2017-02-22-14-34.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "TextField: Fixed IE10 documentation input change behavior",
"type": "patch"
}
],
"email": "manishda@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class TextField extends BaseComponent<ITextFieldProps, ITextFieldState> i
ref={ this._resolveRef('_textElement') }
value={ this.state.value }
onInput={ this._onInputChange }
onChange={ this._onChange }
onChange={ this._onInputChange }
className={ this._textElementClassName }
aria-label={ this.props.ariaLabel }
aria-describedby={ this._isDescriptionAvailable ? this._descriptionId : undefined }
Expand All @@ -265,7 +265,7 @@ export class TextField extends BaseComponent<ITextFieldProps, ITextFieldState> i
ref={ this._resolveRef('_textElement') }
value={ this.state.value }
onInput={ this._onInputChange }
onChange={ this._onChange }
onChange={ this._onInputChange }
className={ this._textElementClassName }
aria-label={ this.props.ariaLabel }
aria-describedby={ this._isDescriptionAvailable ? this._descriptionId : undefined }
Expand All @@ -279,6 +279,9 @@ export class TextField extends BaseComponent<ITextFieldProps, ITextFieldState> i
private _onInputChange(event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>): void {
const element: HTMLInputElement = event.target as HTMLInputElement;
const value: string = element.value;
if (value === this.state.value) {
return;
}

this.setState({
value: value,
Expand Down Expand Up @@ -346,14 +349,4 @@ export class TextField extends BaseComponent<ITextFieldProps, ITextFieldState> i
textField.style.height = scrollHeight + 'px';
}
}

private _onChange(): void {
/**
* A noop input change handler.
* https://github.com/facebook/react/issues/7027.
* Using the native onInput handler fixes the issue but onChange
* still need to be wired to avoid React console errors
* TODO: Check if issue is resolved when React 16 is available.
*/
}
}