Skip to content

Commit 6892f59

Browse files
authored
Focus (cursorToEnd) only if input is active (bl00mber#457)
1 parent 2810bad commit 6892f59

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ class PhoneInput extends React.Component {
460460
// Put the cursor to the end of the input (usually after a focus event)
461461
cursorToEnd = () => {
462462
const input = this.numberInputRef;
463+
if (document.activeElement !== input) return;
463464
input.focus();
464465
let len = input.value.length;
465466
if (input.value.charAt(len-1)=== ')') len = len-1;

0 commit comments

Comments
 (0)