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

Checkbox widget causing height update #64

Closed
krey opened this issue Mar 5, 2019 · 3 comments
Closed

Checkbox widget causing height update #64

krey opened this issue Mar 5, 2019 · 3 comments

Comments

@krey
Copy link

krey commented Mar 5, 2019

Version 0.3.0.

Apologies, I'm having trouble uploading screenshots so I have to describe the problem verbally.

Here's my code

import ipywidgets as widgets
import ipysheet

mysheet = ipysheet.Sheet(rows=2, columns=2)

checkbox_kwargs = dict(
    layout={'width': '1em', 'height': '1em'},
    indent=False, value=True
)

checkbox_cell_kwargs = dict(column_start=0, column_end=0, type='widget')

checkbox_cells = tuple(
    ipysheet.Cell(value=widgets.Checkbox(**checkbox_kwargs), row_start=i, row_end=i, **checkbox_cell_kwargs)
    for i in range(2)
) 

mysheet.cells = checkbox_cells

mysheet

When I enter some text into B1 say, the cell height jumps from 22px to 32px in all rows. This behaviour does not happen if I remove the line

mysheet.cells = checkbox_cells
@martinRenou
Copy link
Contributor

Can you tell me what browser you are using?

Just a comment concerning your issues. Do you have reasons for using a Checkbox widget? Do you plan to display those checkboxes at other places than the sheet?
If not I suggest you don't use the Checkbox widget, you can put boolean values in cells. You would still see checkboxes if you do that, and you would not have the issues that you have concerning widgets synchronization and styling. We are at a very early stage of widgets support, there is still work to do for having stable support.

@martinRenou
Copy link
Contributor

I cannot reproduce your issue using master on the classic Notebook and Chromium. When typing into B1 the cell height does not change.
Are you using JupyterLab?

@krey
Copy link
Author

krey commented Mar 14, 2019

It's fixed in 0.3.1, thank you

@krey krey closed this as completed Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants