material-components-web icon indicating copy to clipboard operation
material-components-web copied to clipboard

[Top App Bar] scrolling bug

Open youra-h opened this issue 4 years ago • 5 comments

Bug report

Steps to reproduce

  1. Go to Top appbar Standart 1.1 Disable height .top-app-bar__frame
  2. Shrink the window to show the scroll bar
  3. Scroll down
  4. The top app bar is gone. ok!
  5. Enlarge the window so that the scroll bar disappears. The top app bar remained unchanged.This is bug.

I am using code like this, at the moment:

window.addEventListener('scroll', () => {
    var element = document.querySelector('body');
    var position = element.getBoundingClientRect();

    // checking whether fully visible
    if(position.top >= 0 && position.bottom <= window.innerHeight) {
        $(topAppBarbar.root).animate({top:0}, 'fast');
        or
        topAppBar.root.style.top = "0";
    }
});

Actual behavior

Expected behavior

Screenshots

Your Environment:

Software Version(s)
MDC Web 8.0.0
Browser Chrome/Opera
Operating System Windows 10

Additional context

Possible solution

youra-h avatar Nov 07 '20 10:11 youra-h

Can you provide the actual versus expected behavior, along with screenshots and a Glitch/Codepen demo?

joyzhong avatar Dec 10 '20 20:12 joyzhong

Codeopen

  1. In the Result window, scroll down to the end
  2. Enlarge the result window so the scroll bar disappears

Step 1 image

Step 2 image

Step 3 image

youra-h avatar Dec 11 '20 09:12 youra-h

Thanks for the Codepen and repro steps! This does seem like a bug, adding to our backlog.

joyzhong avatar Dec 11 '20 18:12 joyzhong

Hi - is there any further update on this? I notice this still happens with version 12. If you make a window small and scroll down, followed by enlarging the window to remove the scrollbar, you will lose the top app bar.

simonziegler avatar Sep 20 '21 18:09 simonziegler

Hi - is there any update on this bug?

simonziegler avatar Mar 16 '22 22:03 simonziegler