Skip to content

Fix: result dropdown is empty until the form re-renders on the Save Flow Result nodes - #227

Merged
priyanshu6238 merged 2 commits into
glific-masterfrom
fix/small_ui_fix_in_the_new
Sep 29, 2026
Merged

priyanshu6238 merged 2 commits into
glific-masterfrom
fix/small_ui_fix_in_the_new

Conversation

@priyanshu6238

@priyanshu6238 priyanshu6238 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On both Save Flow Result and Save Multiple Flow Results, clicking the dropdown arrow on the Result field showed nothing. The existing results only appeared once some unrelated edit happened to re-render the form (typing into Value or Category, picking a row), which made it look like the field only worked if you typed into it first.

Cause

Both forms built their option list in componentDidMount and assigned it to a plain instance field:

public componentDidMount(): void {
  const items = this.props.assetStore.results.items;
  this.options = Object.keys(items).map(...);
}

Two things compound there:

1. React runs a child's componentDidMount before the parent's. TembaSelect.componentDidMount is what hands the list to the <temba-select> element via setOptions(), and at that point the form's options was still [] — so the element was seeded empty.
2. Assigning to an instance field draws no re-render, so TembaSelect.componentDidUpdate the only other setOptions() call site — never fired.

The element was left holding an empty list. Clicking the arrow does reach the right path in temba-components (handleArrowClick → handleContainerClick → focus the searchbox → requestUpdate('input') → fetchOptions('')), but it resolved against an empty staticOptions and rendered nothing.

Fix

Build the options in the constructor so they exist before the first render. The three lines are unchanged — they only run earlier. propbject the old code read, so nothing else about the forms changes.

@priyanshu6238 priyanshu6238 changed the title fix: Add tests for result options in SetRunResultForm and SetRunResul… Fix: result dropdown is empty until the form re-renders on the Save Flow Result nodes Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: dcac7c59-ea0f-4d08-ae7b-764e8bc8e286


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@priyanshu6238 priyanshu6238 self-assigned this Sep 22, 2026
Comment thread src/components/flow/actions/setrunresult/SetRunResultForm.tsx
Comment thread src/components/flow/actions/setrunresults/SetRunResultsForm.tsx
@priyanshu6238
priyanshu6238 merged commit 88b17ac into glific-master Sep 29, 2026
6 checks passed
@priyanshu6238
priyanshu6238 deleted the fix/small_ui_fix_in_the_new branch September 29, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants