Skip to content

Commit

Permalink
fix(DateRangePicker): fix layout misalignment due to missing min-width (
Browse files Browse the repository at this point in the history
#3523)

* fix(DateRangePicker): fix layout misalignment due to missing min-width

* fix: remove data-testid
  • Loading branch information
simonguo committed Dec 28, 2023
1 parent 62de8ca commit 464af79
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DateRangePicker/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,12 @@ const DateRangePicker: DateRangePicker = React.forwardRef((props: DateRangePicke
const panelClasses = prefix('daterange-panel', {
'daterange-panel-show-one-calendar': showOneCalendar
});

/**
* Set a min-width (528px) when there are two calendars
* @see https://github.com/rsuite/rsuite/issues/3522
*/
const panelStyles: React.CSSProperties = { minWidth: showOneCalendar ? 'auto' : 528 };
const styles = { ...menuStyle, left, top };

const calendarProps = {
Expand Down Expand Up @@ -846,7 +852,7 @@ const DateRangePicker: DateRangePicker = React.forwardRef((props: DateRangePicke
target={triggerRef}
style={styles}
>
<div className={panelClasses}>
<div className={panelClasses} style={panelStyles}>
<Stack alignItems="flex-start">
{sideRanges.length > 0 && (
<PredefinedRanges
Expand Down

1 comment on commit 464af79

@vercel
Copy link

@vercel vercel bot commented on 464af79 Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rsuite-nextjs – ./docs

rsuite-nextjs-git-main-rsuite.vercel.app
rsuitejs.com
rsuite.vercel.app
rsuite-nextjs-rsuite.vercel.app

Please sign in to comment.