Usercard cloak not disappears on touchstart

AI-generated summary

On mobile devices, specifically Android, users reported that the usercard backdrop cloak fails to disappear when scrolling, requiring an extra tap to close Don. Canapin noted this prevents interaction with the interface until the card is fully closed. A proposed fix involved replacing the mousedown event with pointerdown to improve compatibility Canapin. Although this change was initially merged by pmusaraj, Canapin subsequently discovered it introduced a new bug where touch events passed through the cloak, triggering elements underneath the overlay. To resolve this, pmusaraj submitted a new pull request that correctly handles the cloak behavior and adds fade-in/fade-out animations.

Hello :waving_hand:

I noticed on mobile (Android 10) when I open a usercard and then scroll the page the (backdrop) cloak still there. Earlier it disappeared with usercard when I started to scroll the page. Now it requires an other tap or tapping outside the usercard to dissapears it.

Thanks :slightly_smiling_face:

2 Likes

I encountered this slightly annoying issue as well.

This is the annoying part since the overlay prevents us from interacting with the interface and requires us to tap while the card has already been closed.

1 Like

Replacing mousedown with pointerdown in discourse/frontend/discourse/app/components/card-contents-base.js at d056c1e358d1cb823632aa4a8c51a42e911969b3 · discourse/discourse · GitHub seems to fix the issue.

Those event weren’t compatible with Safari until 2019, so I guess we could use them? Unless there are caveats I’m unaware of.

3 Likes

Thanks for the PR, it is now merged.

1 Like

Sadly my pr introduces a new bug after all :cry:

When you touch outside the card, the event passes through the cloak and trigger anything that can be clicked beneath.
Here, a topic title:

Sorry about that! :see_no_evil_monkey:

2 Likes

This topic was automatically closed after 15 hours. New replies are no longer allowed.

Good point, no worries, this should fix that (and it also adds fade-in/fade-out for the background cloak):

https://github.com/discourse/discourse/pull/38025

1 Like