Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capturing event listeners to the KeyboardShortcut library #3555

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Jun 11, 2021

Shoutout to @HorusGoul for figuring this out. In the slack thread you made it sound like we should always have capturing event listeners, unless we specifically want to enable bubbling for certain events. I wasn't sure of the potential side-effects of preventing event bubbling by default, so I opted for the minimum change that resolves the current issue. Feel free to follow-up with any thoughts regarding other events which should not bubble.

Details

TBH I'm not 100% clear on why this fixes the linked issue, but shoutout to @HorusGoul for finding this! It works! 🎉

Fixed Issues

Fixes #3512

Tests / QA Steps (Web/Desktop only)

  1. When the main ReportActionCompose is focused, hit CMD+K.
  2. The chat switcher should open and the search bar in the chat switcher should be focused.
  3. Hit Esc and the chat switcher should hide.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

image

Mobile Web

n/a

Desktop

image

iOS

n/a

Android

n/a

@roryabraham roryabraham requested a review from a team June 11, 2021 18:59
@roryabraham roryabraham self-assigned this Jun 11, 2021
@MelvinBot MelvinBot requested review from joelbettner and removed request for a team June 11, 2021 18:59
@OSBotify
Copy link
Contributor

⚠️ ⚠️ Heads up! This pull request has the CP Staging label. ⚠️ ⚠️
Merging it will cause it to be immediately deployed to staging, even if the open StagingDeployCash deploy checklist is locked.

@parasharrajat
Copy link
Member

parasharrajat commented Jun 11, 2021

Not sure at the time but it could have side effects. Like when we want to stop propagation for all listeners.

<document> <---------- don't want it to know
   <div> <------------- don't want it to know
      <div> <-------- event Source.

capturing will fail this scenario.

@marcaaron marcaaron merged commit 584183f into main Jun 11, 2021
@marcaaron marcaaron deleted the Rory-FixHotkeys branch June 11, 2021 19:33
github-actions bot pushed a commit that referenced this pull request Jun 11, 2021
Add capturing event listeners to the KeyboardShortcut library

(cherry picked from commit 584183f)
@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging in version: 1.0.68-2🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.68-4🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.68-5🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.73-3🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMD + K is not working when the focus is on compose box
4 participants