From 459fc4debc621cdd9f134f81443b4b9c58c93664 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Mon, 25 Sep 2023 11:30:13 +0200 Subject: [PATCH] :bug: (bot) Fix reactivity issue when filtering single choices Closes #803 --- packages/embeds/js/package.json | 2 +- .../features/blocks/inputs/buttons/components/Buttons.tsx | 5 ++--- .../blocks/inputs/pictureChoice/SinglePictureChoice.tsx | 6 ++---- packages/embeds/nextjs/package.json | 2 +- packages/embeds/react/package.json | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index 15f0d210e..a2b7321a4 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.1.29", + "version": "0.1.30", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/features/blocks/inputs/buttons/components/Buttons.tsx b/packages/embeds/js/src/features/blocks/inputs/buttons/components/Buttons.tsx index cfe4b0ced..5793cb5ad 100644 --- a/packages/embeds/js/src/features/blocks/inputs/buttons/components/Buttons.tsx +++ b/packages/embeds/js/src/features/blocks/inputs/buttons/components/Buttons.tsx @@ -21,8 +21,7 @@ export const Buttons = (props: Props) => { if (!isMobile() && inputRef) inputRef.focus() }) - // eslint-disable-next-line solid/reactivity - const handleClick = (itemIndex: number) => () => + const handleClick = (itemIndex: number) => props.onSubmit({ value: filteredItems()[itemIndex].content ?? '' }) const filterItems = (inputValue: string) => { @@ -61,7 +60,7 @@ export const Buttons = (props: Props) => { {(item, index) => (