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.
Drop down panels drift away from their buttons on zooming
Note: This is not related to the recent code release - I noticed this before that.
The panels that appear when clicking on the Notifications or Communities buttons at the top right of the page are positioned correctly regardless of zoom level (they automatically appear in the right place for the current zoom). However, if the zoom level is changed while the panel is open, it drifts horizontally and ends up far away from the button it is associated with.
This is much less of a problem following the recent release, now that the button that opened the panel is no longer the only way to close it, so I now see this as more of an aesthetic bug.
This is pretty much by-design.
Zooming in web browsers is not "really" just enlarging the displayed parts, but instead changes a lot of settings/properties for the web page, such as screen resolution/size and base font size. This is generally useful, because it allows websites to adapt to these changes (such as by eventually displaying their mobile layout), but it also makes things more complicated in this case, because the position of both the panel and their button divert.
This means, that the positioning code would have to check for every screen resize event and then recalculate the position and re-apply. The current implementation sets the position when the panel is opened, which is a good-enough bet IMO.
Given that changing this would likely make the code more error-prone and would probably only result in some stuttery movement (have not tested, but re-rendering due to a browser-resize/scroll event is generally discouraged AFAIK), and given that zooming in while a panel is open is IMO very rare and that the issue can be easily resolved by closing and reopening the panel, I don't think this change would be worth the development effort to implement.
0 comment threads