Skip to content

Commit

Permalink
bug(styles): Actually output the data frame (#1544)
Browse files Browse the repository at this point in the history
Co-authored-by: Carson Sievert <[email protected]>
  • Loading branch information
schloerke and cpsievert authored Jul 17, 2024
1 parent a1f0997 commit 9bd9f2d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
3 changes: 3 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ quartodoc_build_express: $(PYBIN) quartodoc_interlinks

## Build test API docs
quartodoc_build_test: $(PYBIN) quartodoc_interlinks
$(eval export SHINY_ADD_EXAMPLES=true)
$(eval export IN_QUARTODOC=true)
$(eval export SHINY_MODE=express)
. $(PYBIN)/activate \
&& echo "::group::quartodoc build testing docs" \
&& quartodoc build --config _quartodoc-testing.yml --verbose \
Expand Down
6 changes: 5 additions & 1 deletion js/data-frame/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,11 @@ const ShinyDataGrid: FC<ShinyDataGridProps<unknown>> = ({
// @ts-ignore:next-line
key={header.id}
colSpan={header.colSpan}
style={{ minWidth: header.getSize() }}
style={{
width: header.getSize(),
// When row numbers are displayed, this value is helpful instead of `width`
// minWidth: header.getSize()
}}
scope="col"
tabIndex={0}
onClick={header.column.getToggleSortingHandler()}
Expand Down
4 changes: 3 additions & 1 deletion shiny/api-examples/data_frame_styles/app-core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@


app_ui = ui.page_fillable(
ui.hr(),
ui.h2(
"Custom styles applied to all cells within a data frame ", ui.HTML("&#128075;")
),
ui.output_data_frame("my_df"),
ui.hr(),
ui.tags.style(
ui.HTML(
"""
Expand All @@ -96,6 +97,7 @@
)
),
ui.h2("Data Frame with Styles applied to 4 cells"),
ui.output_data_frame("hi_df"),
)


Expand Down
2 changes: 1 addition & 1 deletion shiny/www/py-shiny/data-frame/data-frame.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions shiny/www/py-shiny/data-frame/data-frame.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
def test_validate_row_selection_in_edit_mode(
page: Page, local_app: ShinyAppProc
) -> None:
page.set_viewport_size({"width": 1920 * 2, "height": 1080 * 2})
page.goto(local_app.url)

# Select (and verify) a row. Edit a cell content in that row.
Expand Down Expand Up @@ -61,7 +62,9 @@ def test_validate_row_selection_in_edit_mode(
page.keyboard.press("Escape")
page.keyboard.press("Enter")
data_frame.expect_class_state(
"editing", row=1, col=5
"editing",
row=1,
col=0,
) # Stage column begins to be edited.

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

0 comments on commit 9bd9f2d

Please sign in to comment.