Skip to content

Commit

Permalink
Tagpicker ie (#5962)
Browse files Browse the repository at this point in the history
* Add IE example (for debugging only, not to be merged)

* Remove temporary example

* Prevent Autofill onInputChange from being called on inputs with a placeholder in IE

* Add change files
  • Loading branch information
kkjeer authored Aug 17, 2018
1 parent 5e746d1 commit 4ab70f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "",
"packageName": "@uifabric/utilities",
"type": "none"
}
],
"packageName": "@uifabric/utilities",
"email": "kakje@microsoft.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Autofill: prevent onInputChange from being called on IE11 inputs with a placeholder",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "kakje@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ export class Autofill extends BaseComponent<IAutofillProps, IAutofillState> impl
* @param newValue The new value from the input
*/
private _updateValue = (newValue: string) => {
// Only proceed if the value is nonempty and is different from the old value
// This is to work around the fact that, in IE 11, inputs with a placeholder fire an onInput event on focus
if (!newValue && newValue === this._value) {
return;
}
this._value = this.props.onInputChange ? this.props.onInputChange(newValue) : newValue;
this.setState(
{
Expand Down

0 comments on commit 4ab70f3

Please sign in to comment.