ipywidgets icon indicating copy to clipboard operation
ipywidgets copied to clipboard

When a SplitPanel has a lot of contents, scroll bar is moved to bottom

Open smahn9123 opened this issue 1 year ago • 0 comments

Description

As in title, when a tab has a lot of contents, its scroll bar is moved to bottom.

Reproduce

import ipywidgets as widgets
from ipytext import TextBox
from ipylab import JupyterFrontEnd, SplitPanel

tabContents = []

layout = widgets.Layout(width='auto', height='80px', overflow='auto')
text = TextBox(some value, layout=layout)
acc0 = widgets.Accordion([text], selected_index=0)

layout = widgets.Layout(width='auto', height='300px', overflow='auto')
text = TextBox(some value, layout=layout)
acc1 = widgets.Accordion([text], selected_index=0)

layout = widgets.Layout(width='auto', height='500px', overflow='auto')
text = TextBox(some value, layout=layout)
acc2 = widgets.Accordion([text], selected_index=0)

tabContents.append(widgets.VBox([listAcc, gprAcc, csAcc]))
tab = widgets.Tab(tabContents)

panel = SplitPanel(layout=widgets.Layout(overflow='visible'))
panel.children = [tab]
app = JupyterFrontEnd()
app.shell.add(panel, 'right', {'rank': '0'})
app.shell.expand_right()

Upon creating a SplitPanel and adding 3 Accordions with enough height value to cause overflow in height, the scroll bar is just moved down.

image

Expected behavior

I expect that the scroll bar should exist at the top. Is this a bug?

Context

  • ipywidgets version 7.7.1
  • Operating System and version: Windows 10
  • Browser and version: Chrome(latest)

If using JupyterLab

  • JupyterLab version: 3.5.3
Installed Labextensions
 ipylab v0.5.2 enabled ok (python, ipylab)
        ipyparallel-labextension v8.5.1 enabled ok
        ipytext v0.1.0 enabled ok (python, ipytext)
        jupyterlab_pygments v0.2.2 enabled ok (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v3.1.1 enabled ok (python, jupyterlab_widgets)

smahn9123 avatar Oct 04 '23 08:10 smahn9123