chatwoot / chatwoot

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
https://www.chatwoot.com/help-center
Other
19.46k stars 3.08k forks source link

fix: Dashboard phone number input country `undefined` in `onSelectCountry` #9473

Closed iamsivin closed 1 month ago

iamsivin commented 1 month ago

Pull Request Template

Description

This PR will fix this sentry issue

Issue The root cause of this issue is the usage of keyboardEventListenerMixins. The key events are always active when the edit conversation modal is active, even if the country dropdown is not visible. So, if we press the enter key, this error will be thrown into the console.

Solution Remove the use of keyboardEventListenerMixins and handle it directly in the Vue native key events. Also, always check if the dropdown is active.

Other changes

  1. Remove the mouseup event lister and use the click away directive.
  2. Use inline Tailwind css

Fixes https://linear.app/chatwoot/issue/CW-3282/phonenumberinput-country-undefined-in-onselectcountry

Type of change

How Has This Been Tested?

Steps

  1. Open a conversation.
  2. And click the edit contact button
  3. And click the enter key
  4. Now you can see the error in the console

Checklist:

linear[bot] commented 1 month ago

CW-3282 PhoneNumberInput - `country` undefined in `onSelectCountry`

github-actions[bot] commented 2 days ago

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.