Skip to content

itables widget height is incorrect #199

@mwouts

Description

@mwouts

Hi, thanks for maintaining Shiny!

I am the author of ITables, a Python wrapper for DataTables. The package provides a Jupyter Widget using AnyWidget, which works fine in Jupyter, but we see height calculation problems in Shiny, cf. mwouts/itables#360.

A MRE is here:

from shiny import App, ui
from shinywidgets import output_widget, render_widget
from itables.widget import ITable
from itables.sample_dfs import get_countries

app_ui = ui.page_fluid(
    ui.h1("Issue #360"),
    ui.p("The table height is not correct"),
    output_widget("my_table"),
    ui.p("More content, should not hide the table (but it does)"),
)

# Define server
def server(input, output, session):
    @render_widget
    def my_table():
        return ITable(df=get_countries(html=False))

# Create the Shiny app
app = App(app_ui, server)

The problem is that the table is hidden by the next UI component - we get to see only 6 rows when we should see 10, plus some extra information:
Image

In the browser console I see this message:
Image

Honestly I am not sure where the problem resides, within ITables, or AnyWidget, or Shiny, but I would appreciate help or advice on how to address it! Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions