Skip to content

Commit

Permalink
The dataview config popover is-expanded class indicates that the po…
Browse files Browse the repository at this point in the history
…pover is expanded in mobile view.

In this view, ensure that the content is horizontally scrollable and the width takes up the screen.
  • Loading branch information
ramonjd committed Dec 8, 2024
1 parent 7cf1ced commit 68ac15a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/dataviews/src/components/dataviews-view-config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ interface ViewTypeMenuProps {
defaultLayouts?: SupportedLayouts;
}

const DATAVIEWS_CONFIG_POPOVER_PROPS = { placement: 'bottom-end', offset: 9 };
const DATAVIEWS_CONFIG_POPOVER_PROPS = {
className: 'dataviews-config__popover',
placement: 'bottom-end',
offset: 9,
};

function ViewTypeMenu( {
defaultLayouts = { list: {}, grid: {}, table: {} },
Expand Down Expand Up @@ -619,6 +623,7 @@ function DataviewsViewConfigDropdown() {
);
return (
<Dropdown
expandOnMobile
popoverProps={ {
...DATAVIEWS_CONFIG_POPOVER_PROPS,
id: popoverId,
Expand All @@ -636,7 +641,10 @@ function DataviewsViewConfigDropdown() {
);
} }
renderContent={ () => (
<DropdownContentWrapper paddingSize="medium">
<DropdownContentWrapper
paddingSize="medium"
className="dataviews-config__popover-content-wrapper"
>
<VStack className="dataviews-view-config" spacing={ 6 }>
<SettingsSection title={ __( 'Appearance' ) }>
<HStack expanded className="is-divided-in-two">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
line-height: $default-line-height;
}

.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper {
overflow-y: scroll;
height: 100%;
.dataviews-view-config {
width: auto;
}
}

.dataviews-view-config__sort-direction .components-toggle-group-control-option-base {
text-transform: uppercase;
}
Expand Down

0 comments on commit 68ac15a

Please sign in to comment.