Page MenuHomePhabricator

[web] Fix closing MultimediaModal on ESC press bug
ClosedPublic

Authored by patryk on Jul 14 2023, 2:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 1, 4:31 AM
Unknown Object (File)
Sun, Jun 30, 7:08 PM
Unknown Object (File)
Sun, Jun 30, 12:01 AM
Unknown Object (File)
Thu, Jun 27, 12:39 AM
Unknown Object (File)
Wed, Jun 19, 6:45 PM
Unknown Object (File)
Wed, Jun 19, 6:45 PM
Unknown Object (File)
Wed, Jun 19, 6:45 PM
Unknown Object (File)
Wed, Jun 19, 6:45 PM
Subscribers

Details

Summary

Fix for ENG-4327.

This diff solves the issue, where closing MultimediaModal with the ESC key was impossible.

Test Plan

In chat, click on the image and when MultimediaModal is shown, check if ESC key press closes it. Tested on unencrypted and encrypted images.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

patryk held this revision as a draft.

Move outline:none; to separate selector.

web/media/media.css
106–108 ↗(On Diff #28686)

When we focus on element, blue border is created by default. We want to hide it for .mediaContainer.
Before change (tested browser: Safari):

reason1.png (537×726 px, 287 KB)

After change:
after.png (537×683 px, 299 KB)

web/media/multimedia-modal.react.js
133–134 ↗(On Diff #28686)

I moved these attributes from parent div, because we run .focus() on this child div here. That was the reason why ESC key didn't work.

patryk edited the test plan for this revision. (Show Details)
patryk added reviewers: bartek, tomek.
patryk added a reviewer: ashoat.
web/media/media.css
106–108 ↗(On Diff #28686)

Note: also tested on Firefox and Chrome, and it is working as expected. Also, this selector doesn't affect other components.

Thanks for this diff! In the future we should probably move away from you putting me as a reviewer on all of your diffs, but I'm happy to help review this one :)

web/media/media.css
106–108 ↗(On Diff #28686)

This seems like a good change, but I don't understand what it has to do with the ESC key. Should this have been a separate diff?

This revision is now accepted and ready to land.Jul 14 2023, 7:56 AM
web/media/media.css
106–108 ↗(On Diff #28686)

I just weirdly concluded that because we detect ESC key press by focusing on div, it's somehow connected to this diff, but you're right, it should have been a separate diff.