Side toggle in SideControl reads event.target.value instead of the ToggleButtonGroup value arg

オープン 初心者向け
#53 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

ui/src/components/SideControl.tsx:25-28を読み、issueが動作するパターンとして示しているTemperatureFormatSelector.tsx:23のonChangeハンドラーと比較してください。ControlページとScheduleページで、ボタンとその子要素またはリップル領域の両方をクリックして、サイドセレクターを確認してください。抑制された型エラーに頼らず、各クリックで選択した側が正しく保存されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

In ui/src/components/SideControl.tsx:25-28 the onChange handler does setSide(event.target.value) (with a @ts-expect-error suppressing the type error) instead of using MUI's second callback argument (_, value). MUI passes the selected value as the second arg; event.target is whichever DOM node was clicked (the button, a text node, or the TouchRipple overlay span). When the click lands on a child node rather than the that carries the rendered value attribute, event.target.value is undefined/"", so setSide stores an invalid side. Compare with TemperatureFormatSelector.tsx:23 which correctly uses (_, newFormat). This is the primary left/right selector on the Control and Schedule pages, so intermittent clicks can blank the selected side until reload (localStorage falls back to 'left').


Filed from a repo-wide code audit (working tree at bcad746).

主要言語
Rust
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GoogleBot42/podd のほかの issue

GoogleBot42/podd の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。