Skip to content

Commit

Permalink
fix: date picker mobile custom input (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
dextertanyj authored Nov 23, 2023
1 parent 55bb738 commit 2fff232
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion react/src/DatePicker/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const CustomInputButton = forwardRef<object, 'button'>((_props, ref) => {
const refs = useMergeRefs(inputRef, innerRef, ref)

return (
<Button ref={refs} onClick={onOpen}>
<Button ref={refs} onClick={onOpen} maxWidth="full">
please look at source code to see how to use custom elements
</Button>
)
Expand All @@ -88,3 +88,9 @@ export const CustomInput = Template.bind({})
CustomInput.args = {
inputElement: <CustomInputButton />,
}

export const MobileCustomInput = Template.bind({})
MobileCustomInput.args = {
inputElement: <CustomInputButton />,
}
MobileCustomInput.parameters = getMobileViewParameters()
2 changes: 1 addition & 1 deletion react/src/DatePicker/components/DatePickerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const DatePickerWrapper = ({ children }: PropsWithChildren) => {
if (isMobile) {
return (
<Flex>
<DatePickerInput />
{inputToRender}
{children}
</Flex>
)
Expand Down

0 comments on commit 2fff232

Please sign in to comment.