n8design / htwoo

hTWOo - a better Fluent UI framework.
http://my.n8d.at/hTWOo
MIT License
93 stars 9 forks source link

hoo-checkbox cannot be inline scrolled into view #153

Open gabbsmo opened 2 months ago

gabbsmo commented 2 months ago

Describe the bug If you make a long list of checkboxes (e.g. a table grid with selectable rows), the checkboxes are focusable, but the scrollable parent element will not scroll them into view.

This issue seem to only apply when their is a inline scrollable parent element. Scrolling on the document level seem to work as expected.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://jsfiddle.net/7vg2tkfu/
  2. Click the textbox

Expected behavior As with any focusable element, they should automatically be scrolled into view when they receive focus.

Desktop (please complete the following information):

Additional context My workaround:

.hoo-checkbox {
    position: unset; /* position: absolute; seem to be the culprit */
    display: block; /* To get rid of any whitespace */
    width: 0;
    height: 0;
    margin: 0;
}

Fiddle with workaround: https://jsfiddle.net/7vg2tkfu/1/