Skip to content

Commit

Permalink
Show calendar when clicked on date fields
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Nov 28, 2022
1 parent 2607470 commit b27371b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions community-dashboard/app/components/DateRangeInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,13 @@ function DateRangeInput<N extends NameType>(props: Props<N>) {
labelContainerClassName={labelContainerClassName}
readOnly={readOnly}
input={(
<>
<div
className={styles.inputWrapper}
onClick={toggleShowCalendar}
onKeyPress={toggleShowCalendar}
role="button"
tabIndex={0}
>
<RawInput<string>
name="startDate"
className={_cs(
Expand Down Expand Up @@ -366,7 +372,7 @@ function DateRangeInput<N extends NameType>(props: Props<N>) {
onFocus={setShowCalendarTrue}
type="date"
/>
</>
</div>
)}
/>
{!readOnly && showCalendar && (
Expand Down
7 changes: 7 additions & 0 deletions community-dashboard/app/components/DateRangeInput/styles.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
.input-container {
display: flex;
flex-direction: row;
cursor: pointer;

.input-wrapper {
display: flex;
align-items: center;
}

.input {
--color: var(--color-text);
cursor: pointer;
color: var(--color);

&.empty {
Expand Down

0 comments on commit b27371b

Please sign in to comment.