fix: add time-picker placement prop

This commit is contained in:
lyzno1 2025-10-28 15:49:10 +08:00
parent 0b1015e221
commit 7d56ca5294
No known key found for this signature in database
3 changed files with 5 additions and 1 deletions

View File

@ -39,6 +39,7 @@ const TimePicker = ({
notClearable = false,
triggerFullWidth = false,
showTimezone = false,
placement = 'bottom-start',
}: TimePickerProps) => {
const { t } = useTranslation()
const [isOpen, setIsOpen] = useState(false)
@ -204,7 +205,7 @@ const TimePicker = ({
<PortalToFollowElem
open={isOpen}
onOpenChange={setIsOpen}
placement='bottom-start'
placement={placement}
>
<PortalToFollowElemTrigger className={triggerFullWidth ? '!block w-full' : undefined}>
{renderTrigger ? (renderTrigger({

View File

@ -68,6 +68,8 @@ export type TimePickerProps = {
triggerFullWidth?: boolean
/** Show timezone label inline with the time picker */
showTimezone?: boolean
/** Placement of the popup relative to the trigger */
placement?: 'bottom-start' | 'bottom-end' | 'bottom'
}
export type TimePickerFooterProps = {

View File

@ -143,6 +143,7 @@ const AutoUpdateSetting: FC<Props> = ({
title={t(`${i18nPrefix}.updateTime`)}
minuteFilter={minuteFilter}
renderTrigger={renderTimePickerTrigger}
placement='bottom-end'
/>
<div className='body-xs-regular mt-1 text-right text-text-tertiary'>
<Trans