Skip to content

Commit 946f6e4

Browse files
authored
fix: mouse click to select item for IE11 (#172)
* fix: mouse click to select item for IE11 * chore: updated deps
1 parent 4716126 commit 946f6e4

File tree

3 files changed

+1387
-1150
lines changed

3 files changed

+1387
-1150
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"flow-bin": "^0.60.1",
6262
"html-webpack-plugin": "3.2.0",
6363
"husky": "1.2.1",
64-
"jest": "23.6.0",
64+
"jest": "24.8.0",
6565
"lint-staged": "8.1.0",
6666
"prettier": "1.15.3",
6767
"react": "16.6.0",
@@ -78,7 +78,7 @@
7878
"wait-on": "^3.2.0",
7979
"webpack": "4.27.1",
8080
"webpack-cli": "3.1.2",
81-
"webpack-dev-server": "3.1.14"
81+
"webpack-dev-server": "3.7.2"
8282
},
8383
"peerDependencies": {
8484
"prop-types": "^15.0.0",

src/Textarea.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,12 @@ class ReactTextareaAutocomplete extends React.Component<
881881
// If this is a click: e.target is the textarea, and e.relatedTarget is the thing
882882
// that was actually clicked. If we clicked inside the autoselect dropdown, then
883883
// that's not a blur, from the autoselect's point of view, so then do nothing.
884-
const el = e.relatedTarget;
884+
let el = e.relatedTarget;
885+
// IE11 doesn't know about `relatedTarget` // https://stackoverflow.com/a/49325196/2719917
886+
if (el === null) {
887+
el = document.activeElement;
888+
}
889+
885890
if (
886891
this.dropdownRef &&
887892
el instanceof Node &&

0 commit comments

Comments
 (0)