react-phone-input-2 icon indicating copy to clipboard operation
react-phone-input-2 copied to clipboard

onBlur is triggered when I press Enter

Open magicxor opened this issue 2 years ago • 0 comments

Please run the example app and check the browser console.

Expected result: enter Actual result: enter and blur

App.tsx:

import React from 'react';
import PhoneInput from 'react-phone-input-2';
import 'react-phone-input-2/lib/style.css';

function App() {
  return (
    <div>
      <PhoneInput
        onBlur={event => console.log('blur')}
        onEnterKeyPress={event => console.log('enter')}
      />
    </div>
  );
}

export default App;

package.json:

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^12.1.5",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/lodash": "^4.14.182",
    "@types/node": "^16.11.42",
    "@types/react": "^17.0.47",
    "@types/react-dom": "^17.0.17",
    "lodash": "^4.17.21",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-phone-input-2": "^2.15.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.7.4",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

magicxor avatar Jul 05 '22 19:07 magicxor