Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No overflow at the top level in JupyterLab #3247

Open
jasongrout opened this issue Aug 7, 2021 · 4 comments
Open

No overflow at the top level in JupyterLab #3247

jasongrout opened this issue Aug 7, 2021 · 4 comments
Assignees
Milestone

Comments

@jasongrout
Copy link
Member

jasongrout commented Aug 7, 2021

Description

The top-level widget box should scroll so you can see the overflow.

I think this may be the underlying issue for jupyterlab/jupyterlab#10763

Reproduce

On current master, execute:

HBox(layout=dict(width="2000px", height="50px", border="3px solid red"))

Note that in JupyterLab (3.1) you cannot scroll to see the full box:

Screen Shot 2021-08-06 at 5 13 25 PM

This is becaue the top-level jp-OutputArea-output div has the jupyter-widgets class, which masks its overflow:auto with overflow:visible:

Screen Shot 2021-08-06 at 5 14 51 PM

I think recently we added the jupyter-widgets class to this top-level element, but I can't find the issue nor where in the code it happens right now.

Expected behavior

That jp-OutputArea-output div should have overflow: auto, and quite possibly should not have the jupyter-widgets class applied.

Context

  • ipywidgets version current master on JLab 3.1
  • Operating System and version: macOS Catalina
  • Browser and version: Firefox
@jasongrout
Copy link
Member Author

The solution to this should probably be backported to 7.x.

@ibdafna ibdafna self-assigned this Aug 31, 2021
@ibdafna
Copy link
Member

ibdafna commented Sep 7, 2021

@jasongrout I can't reproduce this anymore. Will discuss on our call tomorrow!

@azjps
Copy link

azjps commented Dec 3, 2021

Hi @jasongrout @ibdafna, after spending a bit too long on master trying to trace code to find where the jupyter-widgets CSS class was added, I found out this was fixed a couple years ago in #2500, but no official releases have been published since then. I've tried ipywidgets==8.0.0b0 as well as dev-install.sh with #2500 cherry-picked on ipywidgets==7.6.5, and for both horizontal overflow scrollbars appear for horizontally long widgets.

I think the following are duplicates of this issue: #2499 #2778 #2842 #3184 #3322 #3412

Since this is a blocking issue for a lot of users (myself included, since for example this prevents using widgets showing pandas.DataFrames with a lot of columns), could we backport this to a new release ipywidgets==7.6.x / jupyterlab_widgets==1.0.x? For me personally, I'd prefer not to use ipywidgets==8.x currently to maintain compatibility with kernels of venvs with ipywidgets==7.x installed (and also since its still in beta), and this bug currently exists for all versions of ipywidgets that are compatible with jupyterlab >= 3.0. Thanks in advance.

@azjps
Copy link

azjps commented Dec 3, 2021

In case this helps anyone wanting to do a local install:

# create tmp venv w/ yarn for dev build
conda create -p /tmp/venv-widgets -c conda-forge python=3.8 yarn jupyterlab=3.2.3
conda activate /tmp/venv-widgets

git clone https://github.com/jupyter-widgets/ipywidgets && cd ipywidgets
git checkout 7.6.5
git cherry-pick 57eca692c445148cf54c7a9d05bfbf2c389b091c  # https://github.com/jupyter-widgets/ipywidgets/pull/2500
# optional: bump ipywidgets/_version.py & jupyterlab_widgets/jupyterlab_widgets/_version.py
bash -x ./dev-install.sh
python setup.py bdist_wheel  # build ipywidgets wheel, maybe unnecessary
cd jupyterlab_widgets && python setup.py bdist_wheel  # build jupyterlab_widgets wheel

# Install wheel to venv to use
conda activate my_env
pip install {path to}/ipywidgets/dist/ipywidgets-7.6.*.whl {path to}/ipywidgets/jupyterlab_widgets/dist/jupyterlab_widgets-1.0.*.whl 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants