sl-switch
and sl-checkbox
allow scrolling out of bounds
#1169
Labels
bug
Things that aren't working right in the library.
Describe the bug
I'm encountering strange scrolling behavior caused by the
sl-switch
andsl-checkbox
components under specific conditions. When they appear in the initial scroll view, the behavior is expected. However, when they appear beyond the initial scroll view, the entire viewport allows scrolling beyond the root html container.In Chrome, when you toggle one of these elements, the scroll pops out of bounds, too. Even if I use CSS to constrain scrolling, the bug programmatically puts the scroll position beyond what you can reach with a scrollwheel. There are no errors listed in the console.
Demo
I've prepared a CodePen with a simplified representation. https://codepen.io/freeformflow/pen/rNroBMr?editors=1101
Updated repro with instructions: https://codepen.io/claviska/pen/JjBzyeJ
I constrained the html container to make it more clear. The blue section on the left in blue represents a nav that doesn't scroll. The section on the right has several panels with enough height that it must scroll. The way it's setup now, it will behave properly. If you uncomment the markup starting on line 29, you will see the bug behavior. When I run the demo in Chrome, toggling the lower switches pops the scroll outside the html container. That doesn't happen in Safari for me. I was also able to reproduce this behavior with
sl-checkbox
.Browser / OS
The text was updated successfully, but these errors were encountered: