Repository navigation
リスト列で先頭の選択肢を選べるようにする - #18
Merged
Merged
Conversation
A select whose value matches none of its options falls back to showing the first one. The list editor rendered only the options it was given, so a cell holding a value outside that set, an empty cell being the common case, opened with the first option already displayed. The operator sees that option as chosen. Picking it changes nothing, so no change event fires, onChange and onCommit never run and the edit cannot be committed. With a single option available the cell becomes impossible to fill at all. Render an option carrying the current value when no supplied option matches it, so an empty cell opens empty and choosing any option is a real change. Claude-Session: https://claude.ai/code/session_01X6kUeNeUyb33xQQ8VAZw15
kanchi-Matsumoto
marked this pull request as ready for review
August 25, 2026 06:18
RyoSogawa
reviewed
Aug 27, 2026
Member
|
@kanchi-Matsumoto |
The list editor now always renders an empty option ahead of the configured ones, so the select in the demo shows five options instead of four. Update the count and assert that the first option is the empty one.
Contributor
Author
|
@RyoSogawa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
このPRでできること
list列のセルで、値が選択肢に含まれていない状態から、先頭の選択肢を選んで確定できるようになります。あわせて、設定済みのセルを未選択に戻す操作もできるようになります。
不具合の内容
<select>はvalueに一致する<option>が無いと、ブラウザが先頭の option を表示します。ListEditorはoptionsに渡された選択肢だけを描いていたため、値が選択肢に含まれないセル(未選択の空文字が典型)は、編集を開始した時点で先頭の項目が表示された状態になっていました。利用者にはその項目が選ばれて見えるため、同じ項目をクリックしても値が変わりません。
changeが発火せずonChange/onCommitが呼ばれないので、編集を確定できませんでした。選択肢が1つしかない列では、そのセルを埋める手段が無い状態でした。
変更内容
<option value="" />を常に先頭に描画するようにした(レビューでの提案を採用)ListEditorのテストを追加optionsに渡した選択肢の描画順は変わりません。確認
pnpm typecheckpnpm lintpnpm testpnpm test:e2epnpm buildhttps://claude.ai/code/session_01BjT1GQVAGKdmwChHtSknqz