Skip to content

Commit

Permalink
🐛 (bot) Fix reactivity issue when filtering single choices
Browse files Browse the repository at this point in the history
Closes #803
  • Loading branch information
baptisteArno committed Sep 25, 2023
1 parent 2307231 commit 459fc4d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -61,7 +60,7 @@ export const Buttons = (props: Props) => {
{(item, index) => (
<span class={'relative' + (isMobile() ? ' w-full' : '')}>
<Button
on:click={handleClick(index())}
on:click={() => handleClick(index())}
data-itemid={item.id}
class="w-full"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export const SinglePictureChoice = (props: Props) => {
if (!isMobile() && inputRef) inputRef.focus()
})

// eslint-disable-next-line solid/reactivity
const handleClick = (itemIndex: number) => () => {
const handleClick = (itemIndex: number) => {
const pictureSrc = filteredItems()[itemIndex].pictureSrc
if (!pictureSrc) return
return props.onSubmit({
Expand Down Expand Up @@ -65,8 +64,7 @@ export const SinglePictureChoice = (props: Props) => {
<For each={filteredItems()}>
{(item, index) => (
<button
// eslint-disable-next-line solid/reactivity
on:click={handleClick(index())}
on:click={() => handleClick(index())}
data-itemid={item.id}
class={
'flex flex-col typebot-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between ' +
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.1.29",
"version": "0.1.30",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.1.29",
"version": "0.1.30",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

4 comments on commit 459fc4d

@vercel
Copy link

@vercel vercel bot commented on 459fc4d Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

alphamen.pro
bet7k.online
bot.afric.ai
bot.tobb.pro
ar.nigerias.io
bot.enreso.org
bot.leadmagnet
bot.mail2wa.me
bot.rslabs.pro
bots.bng.tools
bots.bridge.ai
chad.gocto.com
chat.hayuri.id
chat.uprize.hu
chatgpt.lam.ee
chicken.cr8.ai
drayumi.social
gollum.riku.ai
gsbulletin.com
journey.cr8.ai
kopibayane.com
panther.cr7.ai
panther.cr8.ai
pay.sifuim.com
penguin.cr8.ai
privetvplus.me
segredomeu.com
semaknilai.com
talk.gocare.io
test.bot.gives
ticketfute.com
unicorn.cr8.ai
whats-app.chat
apo.nigerias.io
app.blogely.com
apr.nigerias.io
aso.nigerias.io
blackcan.cr8.ai
blackvip.online
bot.4display.nl
bot.a6t-you.com
bot.artiweb.app
bot.devitus.com
bot.reeplai.com
bot.scayver.com
bot.tc-mail.com
carspecs.lam.ee
chat.borang.net
chat.lalmon.com
chat.sureb4.com
conversawpp.com
eventhub.com.au
a.onewebcenter.com
amancarseat.online
amostra-safe.click
andreimayer.com.br
bebesemcolicas.com
bot.innovacion.fun
bot.jogodospix.com
bot.jogomilion.com
bot.lucide.contact
bot.neferlopez.com
bot.photonative.de
bot.rajatanjak.com
bot.samplehunt.com
bot.sinalcerto.com
bot.wphelpchat.com
bots.robomotion.io
brandingmkt.com.br
cadu.uninta.edu.br
chat.daftarjer.com
chat.foxbot.online
chat.hand-made.one
chat.tuanpakya.com
chat.webisharp.com
chatbotforthat.com
descobrindotudo.me
dicanatural.online
digitalhelp.com.au
draraquelnutri.com
drcarlosyoshi.site
goalsettingbot.com
leads.gecoelho.com
noticiasnet.online
novoappespiao.site
omarcodosanjos.com
pant.maxbot.com.br
pantherview.cr8.ai
positivobra.com.br
rollingball.cr8.ai
speciallife.com.br
sub.yolozeeeer.com
survey.digienge.io
tribe.ezbooking.ai
w.onewebcenter.com
zap.techadviser.in
ai.digitaldaftar.in
al.onewebcenter.com
app.danielnalex.com
ask.realversity.org

@vercel
Copy link

@vercel vercel bot commented on 459fc4d Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 459fc4d Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs.typebot.io
docs-git-main-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 459fc4d Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.