Migrate TimePicker to Floating UI #878#952
Conversation
| ${MediaQuery.MaxWidth.lg} { | ||
| flex-direction: column; | ||
| } | ||
|
|
|
|
||
| const handleSelectionDropdownCancel = () => { | ||
| runOnBlurHandler(); | ||
| const open = () => { |
There was a problem hiding this comment.
rename to handleOpen and move to EVENT LISTENERS section
| const handleChange = (value: string) => { | ||
| onChange?.(value); | ||
| runOnBlurHandler(); | ||
| const close = () => { |
There was a problem hiding this comment.
rename to handleClose and move to EVENT LISTENERS section
| onClose={() => close()} | ||
| onDismiss={() => close()} |
There was a problem hiding this comment.
can just be onClose={handleClose()}?
| clickToToggle={false} | ||
| offset={8} | ||
| alignment={alignment} | ||
| fitAvailableHeight |
| onChange={(v) => { | ||
| onChange?.(v); | ||
| close(); | ||
| }} |
There was a problem hiding this comment.
can restore the handleChange function and move the required logic there
There was a problem hiding this comment.
on selection, restore the focus to the InputWrapper
| setFloatingRef, | ||
| getFloatingProps, | ||
| }: DropdownRenderProps) => { | ||
| if (!isOpen) return null; |
There was a problem hiding this comment.
this is probably not needed since ElementWithDropdown already handles the visibility?
| export const Label = styled.label<LabelStyleProps & { $selected?: boolean }>` | ||
| ${(props) => | ||
| props.$selected | ||
| ? Font["body-baseline-bold"] |
There was a problem hiding this comment.
thanks for catching this! looking at Figma, it's meant to be body-baseline-semibold instead
| renderDropdown={renderDropdown} | ||
| onOpen={open} | ||
| onClose={() => close()} | ||
| onDismiss={() => close()} |
There was a problem hiding this comment.
for dismiss action, restore the focus back to the InputWrapper
Changes