Skip to content

Commit

Permalink
fix(FilterBar & VariantManagement): fix tablet device detection (#5571)
Browse files Browse the repository at this point in the history
Fixes #5541
  • Loading branch information
Lukas742 authored Mar 5, 2024
1 parent e6d39b6 commit 8d55d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/main/src/components/FilterBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { filterValue, renderSearchWithValue, syncRef } from './utils.js';

const isPhone = Device.isPhone();
const isTablet = Device.isTablet();
const isDesktop = Device.isDesktop();

export interface FilterBarPropTypes extends CommonProps {
/**
Expand Down Expand Up @@ -253,7 +254,8 @@ const FilterBar = forwardRef<HTMLDivElement, FilterBarPropTypes>((props, ref) =>
if (filterBarCollapsed !== undefined) {
return filterBarCollapsed;
}
return !isTablet;
// isTablet is true for some desktops with touch screens
return !(isTablet && !isDesktop);
}
return true;
})();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPhone, isTablet } from '@ui5/webcomponents-base/dist/Device.js';
import { isDesktop, isPhone, isTablet } from '@ui5/webcomponents-base/dist/Device.js';
import searchIcon from '@ui5/webcomponents-icons/dist/search.js';
import {
enrichEventWithDetails,
Expand Down Expand Up @@ -41,7 +41,8 @@ const _popupHeaderFontFamily = `var(${cssVarVersionInfoPrefix}popup_header_font_

const styles = {
manageViewsDialog: {
width: isPhone() || isTablet() ? '100%' : '70vw',
// isTablet is true for some desktops with touch screens
width: isPhone() || (isTablet() && !isDesktop()) ? '100%' : '70vw',
'&::part(content), &::part(header)': {
padding: 0
},
Expand Down

0 comments on commit 8d55d0f

Please sign in to comment.