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

Scroll Bar not displayed using output widgets and IPython.display #2778

Closed
enryH opened this issue Feb 11, 2020 · 10 comments
Closed

Scroll Bar not displayed using output widgets and IPython.display #2778

enryH opened this issue Feb 11, 2020 · 10 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@enryH
Copy link

enryH commented Feb 11, 2020

Dear Team,
I cannot see the scroll bar when I use the example from @jasongrout (on a windows machine both in notebook and jupterlab). Any Idea how to solve that?

So:

import pandas as pd
from ipywidgets import *
from IPython.display import display
import numpy as np

w_dims = IntSlider()

out = Output()
with out:
    display(pd.DataFrame(np.random.randn(10,300)))

display(HBox([out]))

gives
image

whereas

import pandas as pd
from ipywidgets import *
from IPython.display import display
import numpy as np
display(pd.DataFrame(np.random.randn(5,300)))

yields what I expect:
image

(I need it for a more involved example, but I thought to start easy)

Thanks in advance!

@jasongrout
Copy link
Member

Looking into it, it seems that the overflow:visible css from the jupyter-widgets css class is overriding the JupyterLab overflow:auto css:
Screen Shot 2020-02-11 at 8 43 33 AM

Disabling the overflow:visible class for .jupyter-widgets fixes the issue. One way to fix this is to make more specific .jupyter-widgets.jp-OutputArea-output {overflow: auto} to override the jupyter-widgets default css.

I'm not sure that having overflow:visible as a default is a good idea in general. We have had it for a long time, so it break things quite a bit if we change it now, though.

@jasongrout
Copy link
Member

Here is the line with that css:

@jasongrout
Copy link
Member

Actually, looking at the DOM again, #2500 is an important fix here, in that the jupyter-widgets class that is overriding the overflow is at the root widget render, not just on the output widget.

@jasongrout
Copy link
Member

So actually this issue may be a duplicate of #2499 (i.e., same cause and fix)?

@enryH
Copy link
Author

enryH commented Feb 11, 2020

So I have to set overflow: auto in my local installation of ipywidgets? Or can I do this within a notebook only for the use-case at hand?

@jasongrout
Copy link
Member

I just merged #2500 and tested, and it looks like that solved the issue in JupyterLab. Unfortunately, the fix won't be easy to make (essentially you'd have to tweak the ipywidgets extension to basically apply #2500). It will be in our next release, coming very soon, though.

@jasongrout
Copy link
Member

One (not very satisfactory, but maybe sufficient?) workaround is to set an explicit width for your output widget, like out.layout.width='400px'.

@jasongrout
Copy link
Member

Closing since #2500 fixes this and has been merged.

@jasongrout jasongrout added this to the 8.0 milestone Feb 11, 2020
@jasongrout
Copy link
Member

Closing since #2500 fixes this and has been merged.

But feel free to continue the discussion if you'd like to talk about this or workarounds more.

@enryH
Copy link
Author

enryH commented Feb 12, 2020

Thank you very much @jasongrout ! I will restrict the width for now and since it's updated, I won't have to worry about it for too long anyways:)

@lock lock bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

2 participants