Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dcce36d
Interactivity API: Fix context object proxy references (#59553)
DAreRodz Mar 4, 2024
59e7d64
Font Library: Load/Unload the font face in browser when toggling the …
arthur791004 Mar 4, 2024
b455d76
Navigation Block: Fix erroneous escaping of ampersands (etc) (#59561)
ockham Mar 5, 2024
3c42446
Change fillRule property (#59598)
SantosGuillamot Mar 5, 2024
984ede0
Site Editor: Fix Global Styles outdated output (#59628)
youknowriad Mar 6, 2024
4e8563f
Add pattern title in create modal in post editor (#59550)
ntsekouras Mar 6, 2024
4958400
Fix typo in Dataviews Pagination and Font Collection components (#59656)
rcoll Mar 7, 2024
b3c9f8b
Font Library: Fix typo in upload text (#59655)
mujuonly Mar 7, 2024
c66577a
List view: fix stuck moving animation on Enter (#59644)
ellatrix Mar 7, 2024
67b216a
Site Editor: Restore the back button when navigating to the template …
youknowriad Mar 7, 2024
00fcb56
Site editor: Fix opening of save panel when using the `save` shortcut…
ntsekouras Mar 8, 2024
b78d306
Code block: preserve newlines (#59627)
ellatrix Mar 11, 2024
dee8699
Implement pattern overrides behind `IS_GUTENBERG_PLUGIN` flag (#59702)
talldan Mar 11, 2024
77aff9d
Ensure that errors reported from uploading font files are not duplica…
pbking Mar 11, 2024
e67cb2f
Dataviews: Fix sticky table headers (#59467)
jameskoster Mar 5, 2024
588cc8b
Interactivity: Restore scope on thrown exception in async callback (#…
sirreal Mar 11, 2024
7719a93
Font Library: Refactors the upload handler in order to check if files…
vcanales Mar 11, 2024
7080b67
Fix allow mouse users to edit link text when Link UI is active (#59635)
getdave Mar 11, 2024
b2128cd
Fix create menu after menu switch (#59630)
draganescu Mar 11, 2024
e5f7dd6
Site Editor: Fix selected featured image when opening media library (…
ntsekouras Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Dataviews: Fix sticky table headers (#59467)
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
# Conflicts:
#	packages/dataviews/src/style.scss
  • Loading branch information
5 people authored and getdave committed Mar 11, 2024
commit e67cb2f45bbfd1ef82e40e89a7a7735d1fa7d0e8
3 changes: 3 additions & 0 deletions packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ $z-layers: (

// Ensure modal footer actions appear above modal contents
".edit-site-start-template-options__modal__actions": 1,

// Ensure checkbox + actions don't overlap table header
".dataviews-view-table thead": 1,
);

@function z-index( $key ) {
Expand Down
99 changes: 47 additions & 52 deletions packages/dataviews/src/dataviews.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* WordPress dependencies
*/
import {
__experimentalVStack as VStack,
__experimentalHStack as HStack,
} from '@wordpress/components';
import { __experimentalHStack as HStack } from '@wordpress/components';
import { useMemo, useState, useCallback, useEffect } from '@wordpress/element';

/**
Expand Down Expand Up @@ -92,69 +89,67 @@ export default function DataViews( {
);
return (
<div className="dataviews-wrapper">
<VStack spacing={ 3 } justify="flex-start">
<HStack
alignment="top"
justify="start"
className="dataviews-filters__view-actions"
>
<HStack
alignment="top"
justify="start"
className="dataviews-filters__view-actions"
className="dataviews-filters__container"
wrap
>
<HStack
justify="start"
className="dataviews-filters__container"
wrap
>
{ search && (
<Search
label={ searchLabel }
view={ view }
onChangeView={ onChangeView }
/>
) }
<Filters
fields={ _fields }
{ search && (
<Search
label={ searchLabel }
view={ view }
onChangeView={ onChangeView }
openedFilter={ openedFilter }
setOpenedFilter={ setOpenedFilter }
/>
</HStack>
{ [ LAYOUT_TABLE, LAYOUT_GRID ].includes( view.type ) &&
hasPossibleBulkAction && (
<BulkActions
actions={ actions }
data={ data }
onSelectionChange={ onSetSelection }
selection={ selection }
getItemId={ getItemId }
/>
) }
<ViewActions
) }
<Filters
fields={ _fields }
view={ view }
onChangeView={ onChangeView }
supportedLayouts={ supportedLayouts }
openedFilter={ openedFilter }
setOpenedFilter={ setOpenedFilter }
/>
</HStack>
<ViewComponent
{ [ LAYOUT_TABLE, LAYOUT_GRID ].includes( view.type ) &&
hasPossibleBulkAction && (
<BulkActions
actions={ actions }
data={ data }
onSelectionChange={ onSetSelection }
selection={ selection }
getItemId={ getItemId }
/>
) }
<ViewActions
fields={ _fields }
view={ view }
onChangeView={ onChangeView }
actions={ actions }
data={ data }
getItemId={ getItemId }
isLoading={ isLoading }
onSelectionChange={ onSetSelection }
onDetailsChange={ onDetailsChange }
selection={ selection }
deferredRendering={ deferredRendering }
setOpenedFilter={ setOpenedFilter }
/>
<Pagination
view={ view }
onChangeView={ onChangeView }
paginationInfo={ paginationInfo }
supportedLayouts={ supportedLayouts }
/>
</VStack>
</HStack>
<ViewComponent
fields={ _fields }
view={ view }
onChangeView={ onChangeView }
actions={ actions }
data={ data }
getItemId={ getItemId }
isLoading={ isLoading }
onSelectionChange={ onSetSelection }
onDetailsChange={ onDetailsChange }
selection={ selection }
deferredRendering={ deferredRendering }
setOpenedFilter={ setOpenedFilter }
/>
<Pagination
view={ view }
onChangeView={ onChangeView }
paginationInfo={ paginationInfo }
/>
</div>
);
}
22 changes: 12 additions & 10 deletions packages/dataviews/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
overflow: auto;
box-sizing: border-box;
scroll-padding-bottom: $grid-unit-80;

> div {
min-height: 100%;
}
}

.dataviews-filters__view-actions {
padding: $grid-unit-15 $grid-unit-40 0;
margin-bottom: $grid-unit-15;
flex-shrink: 0;
position: sticky;
left: 0;

.components-search-control {
.components-base-control__field {
max-width: 240px;
Expand All @@ -28,14 +29,14 @@
}

.dataviews-pagination {
margin-top: auto;
position: sticky;
bottom: 0;
background-color: rgba($white, 0.8);
backdrop-filter: blur(6px);
left: 0;
background-color: $white;
padding: $grid-unit-15 $grid-unit-40;
border-top: $border-width solid $gray-100;
color: $gray-700;
flex-shrink: 0;
}

.dataviews-pagination__page-selection {
Expand Down Expand Up @@ -146,17 +147,18 @@
}
}
thead {
position: sticky;
inset-block-start: 0;
z-index: z-index(".dataviews-view-table thead");

tr {
border: 0;
}
th {
position: sticky;
top: -1px;
background-color: $white;
box-shadow: inset 0 -#{$border-width} 0 $gray-100;
padding-top: $grid-unit-10;
padding-bottom: $grid-unit-10;
z-index: 1;
font-size: 11px;
text-transform: uppercase;
font-weight: 500;
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/view-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function ViewTable( {
);

return (
<div className="dataviews-view-table-wrapper">
<>
<table
className="dataviews-view-table"
aria-busy={ isLoading }
Expand Down Expand Up @@ -467,7 +467,7 @@ function ViewTable( {
<p>{ isLoading ? __( 'Loading…' ) : __( 'No results' ) }</p>
) }
</div>
</div>
</>
);
}

Expand Down