Skip to content

Commit

Permalink
fix(date-time-button): Allow click interaction on mobile view.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Sep 19, 2023
1 parent 68f9b31 commit 8c9a50a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/components/form/date-time-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ const ButtonWrapper = styled.span`
${activeCss}
${boxShadowCss}
}
/* Remove pointer events triggered by children of the button.
(they are not captured by floating-ui hover interaction handler.) */
& > button > * {
pointer-events: none;
}
`

const HoverPanel = styled.div`
Expand Down Expand Up @@ -139,8 +145,10 @@ export default function DateTimeButton({

const handleButtonClick = useCallback(
(e) => {
console.log('Datetime button click')
setOpenWithKeyboard(true)
if (typeof interactionProps.onClick === 'function') {
console.log('Datetime button click activates interaction props.click')
interactionProps.onClick(e)
}
},
Expand Down

0 comments on commit 8c9a50a

Please sign in to comment.