Skip to content

Commit

Permalink
feat(list): rest safe areas on inset list
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 31, 2021
1 parent 8375b14 commit 22b8d87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/react/components/List.jsx
Expand Up @@ -6,7 +6,7 @@ import { useThemeClasses } from '../shared/use-theme-classes.js';

const List = forwardRef((props, ref) => {
const {
component = 'ul',
component = 'div',
className,
colors: colorsProp,

Expand Down Expand Up @@ -54,9 +54,12 @@ const List = forwardRef((props, ref) => {
colors.bg,
!inset && !nested && hairlines && 'hairline-t hairline-b',
positionClass('relative', className),
'last-child-hairline-b-none z-10'
'z-10'
),
},
ul: {
common: cls(inset && 'no-safe-areas', 'last-child-hairline-b-none'),
},
inset: {
common: `ml-4-safe mr-4-safe overflow-hidden`,
ios: `rounded-lg`,
Expand All @@ -79,7 +82,7 @@ const List = forwardRef((props, ref) => {

return (
<Component ref={elRef} className={classes} {...attrs}>
{children}
<ul className={c.ul}>{children}</ul>
</Component>
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/types/List.d.ts
Expand Up @@ -2,7 +2,7 @@ interface Props {
/**
* Component's HTML Element
*
* @default 'ul'
* @default 'div'
*/
component?: string;
/**
Expand Down

0 comments on commit 22b8d87

Please sign in to comment.