Skip to content

Commit

Permalink
Data views: expand config drop down on mobile (WordPress#67715)
Browse files Browse the repository at this point in the history
In this view, ensure that the content is horizontally scrollable and the width takes up the screen.Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: megane9988 <megane9988@git.wordpress.org>
  • Loading branch information
ramonjd authored Dec 9, 2024
1 parent 57c5f84 commit 9e03973
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 9e03973

Please sign in to comment.