mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix(date-picker): resolve width clipping issue on 90/110% zoom (#3416)
* fix(date-picker): resolve width clipping issue on 90/110% zoom * fix(date-picker): resolve width clipping issue on 90/110% zoom * Delete .changeset/metal-bats-reflect.md * Update weak-dingos-chew.md * chore: add storybook --------- Co-authored-by: Ryo Matsukawa <76232929+ryo-manba@users.noreply.github.com>
This commit is contained in:
parent
93f1787815
commit
5652e7bddc
5
.changeset/weak-dingos-chew.md
Normal file
5
.changeset/weak-dingos-chew.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@nextui-org/calendar": patch
|
||||
---
|
||||
|
||||
Fixed calendar clipping issue on zoom (#2978)
|
||||
@ -280,7 +280,7 @@ export function useCalendarBase(originalProps: UseCalendarBasePropsComplete) {
|
||||
style: {
|
||||
// @ts-ignore
|
||||
"--visible-months": visibleMonths,
|
||||
"--calendar-width": calendarWidth,
|
||||
"--calendar-width": typeof calendarWidth === "number" ? `${calendarWidth}px` : calendarWidth,
|
||||
} as React.CSSProperties,
|
||||
};
|
||||
|
||||
|
||||
@ -237,6 +237,26 @@ const PresetsTemplate = (args: CalendarProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
const CalendarWidthTemplate = (args: CalendarProps) => {
|
||||
return (
|
||||
<div className="flex gap-4">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<p>calendarWidth: 300</p>
|
||||
<p className="text-small text-default-600">calendarWidth: 300</p>
|
||||
<Calendar {...args} calendarWidth={300} />
|
||||
</div>
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<p className="text-small text-default-600">calendarWidth: 300px</p>
|
||||
<Calendar {...args} calendarWidth="300px" />
|
||||
</div>
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<p className="text-small text-default-600">calendarWidth: 30em</p>
|
||||
<Calendar {...args} calendarWidth="30em" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const Default = {
|
||||
render: Template,
|
||||
args: {
|
||||
@ -348,3 +368,10 @@ export const Presets = {
|
||||
...defaultProps,
|
||||
},
|
||||
};
|
||||
|
||||
export const CalendarWidth = {
|
||||
render: CalendarWidthTemplate,
|
||||
args: {
|
||||
...defaultProps,
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user