Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Comments on Notifications and Communities buttons not responding to icon clicks

Post

Notifications and Communities buttons not responding to icon clicks

+10
−0

Previously, clicking on the icon for Notifications or Communities at the top right of the page resulted in the appropriate drop down panel appearing. Today, the panel only opens if the square area around the icons is clicked. Clicking on the icons themselves does not open the panel (although it still works for closing the panel).

Panels only open when clicking around the edges rather than on the icons

On the desktop site this is confusing, but can be worked around by remembering to click the edges once you know to do this. However, on the mobile site touching a small area around the edge of the icon is more challenging, making navigating the mobile site difficult.

On mobile one other button is affected: the hamburger menu (3 horizontal lines icon) at the top right of the page. As this is a bigger icon it is more difficult to touch the space around it without touching the icon. I find I need to zoom in to make the space around the icon easy to touch, then zoom back out to view the panel that has opened.

I don't know if there are any other similar buttons affected in this way. I've tested that the reactions panel opens fine, but that involves clicking on text rather than an icon.

HTML

In terms of HTML tags, clicking on the <a> tag directly works fine, but clicking on the <span> tag (for the blue notification circle with a number in it) or the <i> tag (for the Notifications envelope icon or the Communities down arrow icon) only works for closing the panel, not opening it.


In case it's related: I saw this behaviour on my first use of the site after the recent code release

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

4 comment threads

Also an issue with comment threads (4 comments)
Confirmed (14 comments)
GitHub issue (1 comment)
workaround (2 comments)
Confirmed
ArtOfCode‭ wrote almost 2 years ago

Yep, confirmed. I noticed this last night but didn't have time to fix it - took an annoyingly long time to track down to something this simple!

Mithical‭ wrote almost 2 years ago

ArtOfCode‭ - Does that mean you've tracked down the source and can fix it when you have time, or does someone still need to figure out what's causing the bug?

ArtOfCode‭ wrote almost 2 years ago

Mithical‭ haven't tracked down the source, but we may already have a fix in the pipeline - if not there's some more digging to do.

trichoplax‭ wrote almost 2 years ago

Not sure if you've already seen Moshi's comment on this Meta post but I had a quick look and it appears that the change from that pull request is only present in develop, not in master. It's also not present in the code on the live site, so I'm guessing master is the branch used for deployment?

Monica Cellio‭ wrote almost 2 years ago

trichoplax‭ we deploy from develop, but after a change gets made in co-design it then needs to propagate to qpixel and then be deployed, and I'm not sure where that stands.

@ArtOfCode tonight I noticed that this bug doesn't occur with the mod menu; I clicked on the word "mod" rather than under it and it took me to the flags page as I expected. Is the code for that one different somehow?

trichoplax‭ wrote almost 2 years ago

Thanks for explaining, Monica.

As for the mod menu, I don't have access to it, not being a mod here, but Canina's comment on this same Meta post may give a clue. It sounds like buttons that have an icon have the problem, but buttons that just have text are unaffected.

This would be consistent with the underlying cause, that a click on a nested HTML element is what triggers the problem.

trichoplax‭ wrote almost 2 years ago

For a button with an icon, the HTML looks something like this (simplified for illustration):

<a>        // The <a> element corresponds to the whole "button"
    <i>    // The <i> element inside the <a> element corresponds to the icon image
    </i>
</a>

Clicking on the icon (the <i> element) triggers the bug in the code, which closes the panel before the user has time to see it has opened (for all practical purposes, the panel never opens).

Clicking in the whitespace around the icon avoids clicking on the <i> element so only the <a> element is clicked on, resulting in the panel opening successfully.

trichoplax‭ wrote almost 2 years ago · edited almost 2 years ago

For a button with only text, the HTML looks something like this:

<a>        // The <a> element corresponds to the whole "button"
    Text   // The text inside the <a> element does not have an additional <i> element
</a>

Clicking on the text counts as clicking on the <a> element directly, as there is no nested <i> element, so the bug is not triggered.

trichoplax‭ wrote almost 2 years ago

The mod menu that Canina saw the problem with was a different mod menu that does have an icon. It seems consistent with the explanation that only the mod menu with an icon has the problem.

Monica Cellio‭ wrote almost 2 years ago

Thanks for all the debugging help, trichoplax‭!

Monica Cellio‭ wrote almost 2 years ago

The dashboard and mobile sign-on widgets also have icons but do not have the bug. Are those icons actually characters in some font and not images?

trichoplax‭ wrote almost 2 years ago

I think those are unaffected as they link to a new page (they are standard links, rather than being links overridden by JavaScript to behave like buttons). The bug is in the JavaScript, so a link that works without JavaScript (just using the default HTML behaviour for a link) is unaffected.

trichoplax‭ wrote almost 2 years ago

(So the only places the bug is a problem are where a panel opens on the same page, rather than the link going to a new page.)

Monica Cellio‭ wrote almost 2 years ago

Ah, in-page panel versus link -- thanks! I've tried to capture all this in a bug report here: https://github.com/codidact/qpixel/issues/923.