🐛 (pictureChoice) Fix dynamic image only variable saving
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.2.52",
|
||||
"version": "0.2.53",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -3,7 +3,7 @@ import { PictureChoiceBlock } from '@typebot.io/schemas/features/blocks/inputs/p
|
||||
import { For, Show, createEffect, createSignal, onMount } from 'solid-js'
|
||||
import { Checkbox } from '../buttons/components/Checkbox'
|
||||
import { SendButton } from '@/components'
|
||||
import { isDefined, isEmpty, isSvgSrc } from '@typebot.io/lib'
|
||||
import { isDefined, isEmpty, isNotEmpty, isSvgSrc } from '@typebot.io/lib'
|
||||
import { SearchInput } from '@/components/inputs/SearchInput'
|
||||
import { isMobile } from '@/utils/isMobileSignal'
|
||||
import { defaultPictureChoiceOptions } from '@typebot.io/schemas/features/blocks/inputs/pictureChoice/constants'
|
||||
@ -47,7 +47,7 @@ export const MultiplePictureChoice = (props: Props) => {
|
||||
const item = props.defaultItems.find(
|
||||
(item) => item.id === selectedItemId
|
||||
)
|
||||
return item?.title ?? item?.pictureSrc
|
||||
return isNotEmpty(item?.title) ? item.title : item?.pictureSrc
|
||||
})
|
||||
.join(', '),
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { SearchInput } from '@/components/inputs/SearchInput'
|
||||
import { InputSubmitContent } from '@/types'
|
||||
import { isMobile } from '@/utils/isMobileSignal'
|
||||
import { isDefined, isSvgSrc } from '@typebot.io/lib/utils'
|
||||
import { isDefined, isNotEmpty, isSvgSrc } from '@typebot.io/lib/utils'
|
||||
import { PictureChoiceBlock } from '@typebot.io/schemas/features/blocks/inputs/pictureChoice'
|
||||
import { For, Show, createEffect, createSignal, onMount } from 'solid-js'
|
||||
|
||||
@ -24,7 +24,7 @@ export const SinglePictureChoice = (props: Props) => {
|
||||
const handleClick = (itemIndex: number) => {
|
||||
const item = filteredItems()[itemIndex]
|
||||
return props.onSubmit({
|
||||
label: item.title ?? item.pictureSrc ?? item.id,
|
||||
label: isNotEmpty(item.title) ? item.title : item.pictureSrc ?? item.id,
|
||||
value: item.id,
|
||||
})
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/nextjs",
|
||||
"version": "0.2.52",
|
||||
"version": "0.2.53",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.2.52",
|
||||
"version": "0.2.53",
|
||||
"description": "Convenient library to display typebots on your React app",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
Reference in New Issue
Block a user