Add props.onImageChange check in the slider change description handler
This commit is contained in:
parent
fedcfea23f
commit
46db039ced
|
@ -46,8 +46,10 @@ export const ImageSwiper = (props: Props) => {
|
||||||
} = useSnackbar()
|
} = useSnackbar()
|
||||||
|
|
||||||
const handleSlideDescriptionChange = (index: number, field: string, value) => {
|
const handleSlideDescriptionChange = (index: number, field: string, value) => {
|
||||||
|
if (props.onImageChange) {
|
||||||
props.onImageChange(index, { ...props.images[index], [field]: value })
|
props.onImageChange(index, { ...props.images[index], [field]: value })
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const swipeToUploaded = () => {
|
const swipeToUploaded = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
mainSwipeRef.current.swiper.slideTo(props.images.length - 1)
|
mainSwipeRef.current.swiper.slideTo(props.images.length - 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user