Skip to content

Commit

Permalink
fix(editor): 🐛 Variables button in text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 10, 2022
1 parent 4767cdc commit 36838f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const TextBubbleEditor = ({ initialValue, onClose }: Props) => {
rounded="md"
bgColor="white"
w="250px"
zIndex={10}
>
<VariableSearchInput
onSelectVariable={handleVariableSelected}
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/components/shared/VariableSearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const VariableSearchInput = ({

useEffect(() => {
const variable = variables.find((v) => v.name === debouncedInputValue)
onSelectVariable(variable)
if (variable) onSelectVariable(variable)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [debouncedInputValue])

Expand Down
5 changes: 5 additions & 0 deletions apps/builder/playwright/tests/bubbles/text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ test.describe('Text bubble step', () => {
})
await page.click('[data-testid="link-button"]')

await page.press('div[role="textbox"]', 'Shift+Enter')
await page.click('button >> text=Variables')
await page.fill('[data-testid="variables-input"]', 'test')
await page.click('text=Create "test"')

await page.click('text=Preview')
await expect(
typebotViewer(page).locator('span.slate-bold >> nth=0')
Expand Down

2 comments on commit 36838f0

@vercel
Copy link

@vercel vercel bot commented on 36838f0 Mar 10, 2022

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
app.typebot.io
builder-v2-git-main-typebot-io.vercel.app

Please sign in to comment.