home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1031724989

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1031724989 PR_kwDOAMm_X84tdK1y 5880 Alternate method using inline css to hide regular html output in an untrusted notebook 2807085 closed 0     10 2021-10-20T18:47:19Z 2021-11-24T09:45:37Z 2021-11-13T05:16:48Z CONTRIBUTOR   0 pydata/xarray/pulls/5880

When using xarray in a jupyterlab notebook environment with lab extensions loading external css libraries (e.g., bootstrap), the hidden html5 attribute applied to the 'xr-wrap' div element is actually respected and cannot be escaped using a display change in the xarray included css.

The html hidden attribute was weakly enforced in some browsers, but bootstrap added this rule to ensure it took effect as early as v4.0: https://github.com/twbs/bootstrap/blob/v4.0.0/scss/_reboot.scss#L480-L482

This means that not only does the normal html content inside the xr-wrap div not display in a trusted notebook environment that has this type of css rule applied from an external library, the fallback text display mechanism in the pre element does not kick in because the css block is present and sets that content to 'display: none' and so then you just get blank output in the cell when trying to display a Dataset, which is not ideal.

This PR addresses the above problem and maintains a fallback display mechanism when in an untrusted notebook. In a trusted environment, the css will be loaded and the inline css for 'xr-wrap' of 'display:none' will be overridden by the embedded css style block of 'display: block !important', displaying the expected html. In an untrusted environment, the css block will be removed (not hiding the pre element) but the inline style will remain (hiding the 'xr-wrap' div element), leaving the pre text to load instead.

  • [x] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5880/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 10 rows from issue in issue_comments
Powered by Datasette · Queries took 0.549ms · About: xarray-datasette