Skip to content

Commit 9bd9f2d

Browse files
schloerkecpsievert
andauthored
bug(styles): Actually output the data frame (#1544)
Co-authored-by: Carson Sievert <[email protected]>
1 parent a1f0997 commit 9bd9f2d

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

docs/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ quartodoc_build_express: $(PYBIN) quartodoc_interlinks
8080

8181
## Build test API docs
8282
quartodoc_build_test: $(PYBIN) quartodoc_interlinks
83+
$(eval export SHINY_ADD_EXAMPLES=true)
84+
$(eval export IN_QUARTODOC=true)
85+
$(eval export SHINY_MODE=express)
8386
. $(PYBIN)/activate \
8487
&& echo "::group::quartodoc build testing docs" \
8588
&& quartodoc build --config _quartodoc-testing.yml --verbose \

js/data-frame/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,11 @@ const ShinyDataGrid: FC<ShinyDataGridProps<unknown>> = ({
724724
// @ts-ignore:next-line
725725
key={header.id}
726726
colSpan={header.colSpan}
727-
style={{ minWidth: header.getSize() }}
727+
style={{
728+
width: header.getSize(),
729+
// When row numbers are displayed, this value is helpful instead of `width`
730+
// minWidth: header.getSize()
731+
}}
728732
scope="col"
729733
tabIndex={0}
730734
onClick={header.column.getToggleSortingHandler()}

shiny/api-examples/data_frame_styles/app-core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@
7676

7777

7878
app_ui = ui.page_fillable(
79-
ui.hr(),
8079
ui.h2(
8180
"Custom styles applied to all cells within a data frame ", ui.HTML("&#128075;")
8281
),
82+
ui.output_data_frame("my_df"),
83+
ui.hr(),
8384
ui.tags.style(
8485
ui.HTML(
8586
"""
@@ -96,6 +97,7 @@
9697
)
9798
),
9899
ui.h2("Data Frame with Styles applied to 4 cells"),
100+
ui.output_data_frame("hi_df"),
99101
)
100102

101103

shiny/www/py-shiny/data-frame/data-frame.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/py-shiny/data-frame/data-frame.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/playwright/shiny/components/data_frame/validate_row_selection_edit_mode/test_validate_row_selection_edit_mode.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
def test_validate_row_selection_in_edit_mode(
1313
page: Page, local_app: ShinyAppProc
1414
) -> None:
15+
page.set_viewport_size({"width": 1920 * 2, "height": 1080 * 2})
1516
page.goto(local_app.url)
1617

1718
# Select (and verify) a row. Edit a cell content in that row.
@@ -61,7 +62,9 @@ def test_validate_row_selection_in_edit_mode(
6162
page.keyboard.press("Escape")
6263
page.keyboard.press("Enter")
6364
data_frame.expect_class_state(
64-
"editing", row=1, col=5
65+
"editing",
66+
row=1,
67+
col=0,
6568
) # Stage column begins to be edited.
6669

6770
# Click outside the table/Press Escape to exit row focus.

0 commit comments

Comments
 (0)