Skip to content

Commit

Permalink
fix(calendar-input): trigger onFocus if passed (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros authored Oct 21, 2024
1 parent 17bd511 commit 293505d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@dhis2-ui/input": "10.0.0-alpha.4",
"@dhis2-ui/layer": "10.0.0-alpha.4",
"@dhis2-ui/popper": "10.0.0-alpha.4",
"@dhis2/multi-calendar-dates": "2.0.0-alpha.2",
"@dhis2/multi-calendar-dates": "2.0.0-alpha.5",
"@dhis2/prop-types": "^3.1.2",
"@dhis2/ui-constants": "10.0.0-alpha.4",
"@dhis2/ui-icons": "10.0.0-alpha.4",
Expand Down
1 change: 1 addition & 0 deletions components/calendar/src/calendar-input/calendar-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const CalendarInput = ({

const onFocus = () => {
setOpen(true)
rest?.onFocus?.()
}

const languageDirection = useResolvedDirection(dir, locale)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export function CalendarWithEditiableInput() {
const date = selectedDate?.calendarDateString
setDate(date)
}}
onFocus={() => {
console.log('focused')
}}
width="400px"
minDate="2020-07-01"
maxDate="2020-07-09"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2707,10 +2707,10 @@
i18next "^10.3"
moment "^2.24.0"

"@dhis2/[email protected].3":
version "2.0.0-alpha.3"
resolved "https://registry.yarnpkg.com/@dhis2/multi-calendar-dates/-/multi-calendar-dates-2.0.0-alpha.3.tgz#37bab8ccba25c1b060c85a3d6fa3f2f0e71e26ac"
integrity sha512-og8OryjLzPmEtDR4T53R1sQ3ae8VzMU6aWLz9Rx22UM140tzGeNh9+CFhgYXnrokEqFQRs3Qyt3eLqgDOmAatw==
"@dhis2/[email protected].5":
version "2.0.0-alpha.5"
resolved "https://registry.yarnpkg.com/@dhis2/multi-calendar-dates/-/multi-calendar-dates-2.0.0-alpha.5.tgz#5c7a8666a090660bb341d05c64b3464a087d58c0"
integrity sha512-ylOEMk1Va3GS+HSIRDp+f03XZ4f1RJf3j3UFmpNMMVyYjzSw2j+m/wfD+kqtpZlM3GuIwu80rFreHTR5IMrasA==
dependencies:
"@dhis2/d2-i18n" "^1.1.3"
"@js-temporal/polyfill" "0.4.3"
Expand Down

0 comments on commit 293505d

Please sign in to comment.