A reusable panel or modal must always reset its scroll position. This happens before new content is shown. This ensures the user sees the top of the new content.
By Pawan Nayar · from the LLOS AI Learning record
A reusable panel or modal must always reset its scroll position.
This happens before new content is shown. This ensures the user sees the top of the new content.
A developer should reset the scroll position of a reusable panel or modal. This action must happen before the panel or modal displays new content. This ensures the user always starts viewing content from the top. It prevents the user from seeing old content or a blank space.
A developer creates a website with a modal window for showing product details. When a user clicks on a product, the modal opens. If the developer does not reset the scroll position, the modal might open scrolled to the middle or bottom. The user would not see the product's main image or title first.
Resolved from this lesson's own record — real definitions, not invented for this page.
More from the same record, pulled by shared topic — not written new for this page.
The difference between desktop and mobile views should be handled by CSS, not by having separate files. Desktop rules go inside `@media (min-width:901px)`.
The `overflow:hidden` property tells a web browser to hide content that goes outside an element's box. This can cause problems for animations.
A page with much content needs a scrollbar. The footer should not always be visible.
A button should only be as wide as its text and the space around the text. This is called content-sized.
A reusable panel or modal must always reset its scroll position. This happens before new content is shown. This ensures the user sees the top of the new content.