djangoproject.com icon indicating copy to clipboard operation
djangoproject.com copied to clipboard

Improve docs version-switcher mobile styles (django#1488)

Open circus2271 opened this issue 1 year ago • 11 comments

https://github.com/django/djangoproject.com/assets/6430448/33dd10b2-e94f-44e2-92ba-83e06e7c4c94

circus2271 avatar Mar 02 '24 02:03 circus2271

it may be confusing that video example has only 2 versions of documentation and two versions of language, but this is because I had troubles with configuring my local database for this project..

(that's not because of css)

circus2271 avatar May 16 '24 09:05 circus2271

@circus2271 If the bug here is that using the mobile version of the site and clicking the buttons multiple times results in the extra utilities inconsistently showing the other options, that's still happening even with the change.

tim-schilling avatar Sep 18 '25 22:09 tim-schilling

@circus2271 I think this is a byproduct of Browser Developer Tool's "Touch Simulation" feature and then clicking quickly. I see two events in the console when logging them on this click handler when this problem is triggered. One has a pointerType: "mouse" and the other pointerType: "touch"

tim-schilling avatar Sep 18 '25 22:09 tim-schilling

Thanks for looking into this, @tim-schilling! @circus2271 Do you think we can close this?

adamzap avatar Sep 19 '25 22:09 adamzap

Hi, @tim-schilling

The bug I tried to fix is that menu remains opened when I double tap on its button. This behaviour is due to css styles.

This menu opens due to css styles and due to js at the same time. If I hover this button on desktop, it opens. When I click on it, it remains opened. The same thing happens on mobile version: second tap on button makes it hidden through js, but hover styles are still applied, so this menu remains visible. The fix is to remove those hover styles from mobile version as they are redundant

Here is some short video to illustrate this idea:

https://github.com/user-attachments/assets/47ff8302-fb63-4ef2-8433-c45c87fd0b82

circus2271 avatar Sep 23 '25 13:09 circus2271

@adamzap

Maybe it needs some more investigation, as there was no clear description here

circus2271 avatar Sep 23 '25 13:09 circus2271

@circus2271 Can you include a series of steps to reproduce this that isn't just a video please? I'm seeing what I would consider weird behavior on my phone with the production site, but I'm not sure it's the same as what you're trying to fix.

tim-schilling avatar Sep 23 '25 18:09 tim-schilling

Ok, @tim-schilling

Open https://docs.djangoproject.com/en/5.2/, tap on language button, second tap on it doesn't close the menu

circus2271 avatar Sep 23 '25 19:09 circus2271

@circus2271 thank you for that clarification! I was getting tripped up earlier by the term "double-click". I assumed that mean two very quick clicks in succession. Not two separate clicks.

tim-schilling avatar Oct 03 '25 13:10 tim-schilling

no problem @tim-schilling

thank you for your attention

circus2271 avatar Oct 03 '25 13:10 circus2271