Skip to content

Commit

Permalink
Add a regression test for issue #13787
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpap committed May 2, 2024
1 parent 142f84c commit be35df7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dialog bbox=[0, 0, 400, 200]
bokeh.models.dom.Text
DataTable bbox=[6, 33, 388, 160]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions bokehjs/test/integration/regressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
GridPlot,
Tooltip,
Node, Indexed,
Dialog,
} from "@bokehjs/models"

import {
Expand Down Expand Up @@ -3917,4 +3918,38 @@ describe("Bug", () => {
await display(plot)
})
})

describe("in issue #13787", () => {
it("doesn't allow to render a DataTable in a Dialog", async () => {
const source = new ColumnDataSource({
data: {
col1: ["a", "b", "c", "d"],
col2: [1, 2, 3, 4],
col3: [10, 20, 30, 40],
},
})

const columns = [
new TableColumn({field: "col1", title: "col1"}),
new TableColumn({field: "col2", title: "col2"}),
new TableColumn({field: "col3", title: "col3"}),
]
const data_table = new DataTable({source, columns, sizing_mode: "stretch_both"})

const dialog = new Dialog({
title: "Dialog with a data table",
content: data_table,
stylesheets: [`
:host {
position: relative; /* the default is fixed */
left: 10px;
top: 10px;
width: 400px;
height: 200px;
}
`],
})
await display(dialog, [450, 250])
})
})
})

0 comments on commit be35df7

Please sign in to comment.