Hi! I found a endless loop, which can be created if a controlled DateTimePicker component sets a object instead of a string. I have a "good" and a "evil" example which you can copy into the playground,p:~Htesting)))
π
import React, { useEffect, useState } from "react"
import { DateTimePicker } from "juno-ui-components"
export default function App() {
const [testState, setTestState] = useState({
date: {
end: null
},
})
return (
<DateTimePicker
value={testState?.date?.end}
dateFormat="Y-m-d H:i"
label="Select a end date"
enableTime
time_24hr
required
onChange={(e, f) => {
console.log("end date as a string:", f)
setTestState({ ...testState, date: { end: f } })
}}
/>
)
}
π
import React, { useEffect, useState } from "react"
import { DateTimePicker } from "juno-ui-components"
export default function App() {
const [testState, setTestState] = useState({
date: {
end: null
},
})
return (
<DateTimePicker
value={testState?.date?.end}
dateFormat="Y-m-d H:i"
label="Select a end date"
enableTime
time_24hr
required
onChange={(e, f) => {
console.log("end date as a object", e)
setTestState({ ...testState, date: { end: e } })
}}
/>
)
}
Hey Tilman,
thanks for reporting this issue, I can reproduce it locally, too. I think I know where to look, but I will not have the time to investigate any further until mid next week.
Hi! I found a endless loop, which can be created if a controlled DateTimePicker component sets a object instead of a string. I have a "good" and a "evil" example which you can copy into the playground,p:~Htesting)))
π
π