Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're curious to learn more, this is often referred to as "layout shift". There are black-hat designers who deliberately use it as a dark pattern -- you might notice a suspicious number of cases where the most common click target is replaced by a click target (or late-arriving popup) for submitting an email address or entering the sales funnel. But typically it's just bad design.

In the latter case, you could quietly disable buttons after a layout shift, but this can cause problems when users attempt to interact with an onscreen element only to have it mysteriously ignore them. You could visually indicate the disabled state for a few hundred milliseconds, but this would appear as flicker. If you want to be very clever you could pass a tap/click to the click target that was at that location a few tens/hundreds of milliseconds prior, but now you've got to pick a cutoff based on average human response times which may be too much for some and tool little for others. That also wouldn't help with non-click interactions such as simply attempting to read content -- while not as severe, trying to read a label that suddenly moves can be almost as frustrating. Some products attempt to pause layout shifts that might impact an element that the user is about to interact with, but while this is possible with a mouse cursor to indicate intent it can be harder to predict on mobile.

Some of these ideas are even used in cases where a layout shift is necessary such as in a livestream with interactive elements. However, the general consensus is to use content placeholders for late-loading content and avoid rendering visible elements, especially interactive ones, until you have high confidence that they will not continue to move. That's why most browsers provide penalties for websites with "cumulative layout shift", e.g. see https://web.dev/articles/cls



I just found that URL independently! I just added it to my medium post.

Why do we even show interactable elements when the final layout isn't completed yet?


> Why do we even show interactable elements when the final layout isn't completed yet?

Typically such a product either doesn't have sufficient UX attention, or it has black-hat UX folks.

Optimally toolkits and browsers should have handled this since they know the layout dependencies. If an element is still loading and it doesn't have fixed dimensions then all elements whose positions are dependent on that element should not be shown.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: