Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

RadioButtonControl calls onChange twice per selection (Radio.Group onChange plus a per-button onClick)

Open Beginner friendly
#44,921 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@FrancescoCastaldi is already working on this.

Since Oct 3, 2026.

  • #44945 by @FrancescoCastaldi — open
  • #45064 by @anshuman9468 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start in superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx, especially the Radio.Group handler at L72-L75 and each Radio.Button's onClick at L96-L99. Review the React Testing Library coverage for Explore controls, then preserve focus behavior while ensuring the control invokes onChange only once for an actual selection change and not for the selected option.

Written by the indexing model from the issue text.

Description

#bug 🦾 ai-candidate
Bug description

RadioButtonControl wires the change in two places: Radio.Group onChange and an onClick on every Radio.Button. Selecting a different option fires both, so onChange runs at least twice with the same value (the click can also reach the handler via both the label and the inner input). Clicking the already-selected button also fires onChange through onClick even though nothing changed. Controls that dispatch on change (control panel, ColumnConfig form items, MapView/ZoomConfig mode switches) therefore dispatch duplicate updates.

Steps to reproduce: render RadioButtonControl with an onChange spy and click an unselected option: the spy is called more than once. Click the selected option: the spy is still called.

Expected: one call per actual change.

Where

superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx

  • L72-L75 <Radio.Group value={currentValue} onChange={e => onChange(e.target.value)}>
  • L96-L99 onClick={e => { e.currentTarget?.focus(); onChange(val); }}

(VerticalRadioControl.tsx only uses the Group onChange, so it is not affected.)

Suggested fix

Keep only the Radio.Group onChange; move the focus() call into a click handler that does not call onChange.

Found by

Found while adding React Testing Library coverage for Explore controls (all line numbers are against master at bc3698b5d6).

Dominant language
Python
Stars
75.2k
Forks
18.5k
Avg merge
2d 13h
Merged PRs (30d)
608

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/superset

All issues in apache/superset

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.