diff --git a/packages/react-calendar/src/Flex.tsx b/packages/react-calendar/src/Flex.tsx index 8ac693bb..ac4b3424 100644 --- a/packages/react-calendar/src/Flex.tsx +++ b/packages/react-calendar/src/Flex.tsx @@ -1,6 +1,6 @@ import { Children, cloneElement } from 'react'; -type FlexProps = React.HTMLAttributes & { +type FlexProps = React.HTMLAttributes & { // biome-ignore lint/suspicious/noExplicitAny: Too complex to type children: React.ReactElement[]; className?: string; @@ -26,12 +26,14 @@ export default function Flex({ ...otherProps }: FlexProps): React.ReactElement { return ( -
{ const marginInlineStart = offset && index === 0 ? toPercent((100 * offset) / count) : null; - return cloneElement(child, { - ...child.props, - style: { - flexBasis: toPercent(100 / count), - flexShrink: 0, - flexGrow: 0, - overflow: 'hidden', - marginLeft: marginInlineStart, - marginInlineStart: marginInlineStart, - marginInlineEnd: 0, - }, - }); + return ( +
  • + {cloneElement(child, { + ...child.props, + style: { + flex: 1, + }, + })} +
  • + ); })} -
    + ); } diff --git a/packages/react-calendar/src/Tile.tsx b/packages/react-calendar/src/Tile.tsx index ec765f3c..9e7c2706 100644 --- a/packages/react-calendar/src/Tile.tsx +++ b/packages/react-calendar/src/Tile.tsx @@ -120,6 +120,7 @@ export default function Tile(props: TileProps): React.ReactElement { onMouseOver={onMouseOver ? () => onMouseOver(date) : undefined} style={style} type="button" + aria-pressed={!!classes?.find((classString) => classString.indexOf('--active') != -1 || classString.indexOf('--hasActive') != -1)} > {formatAbbr ? {children} : children} {tileContent}