Open
Conversation
Contributor
|
今回のは調査からなので |
Collaborator
|
@riririn180904 |
There was a problem hiding this comment.
Pull request overview
このPRは、電力申請フォームでタブ切り替え時に入力内容がリセットされてしまう問題(#1973)を修正するものだよ〜✨
コピー&ペースト作業中にタブを切り替えると、フォームが再マウントされて入力中のデータが消えちゃうっていうユーザビリティ的にエグい問題があったんだよね😫 これを条件描画からCSS制御に変更することで、フォームのマウント状態を維持したまま表示/非表示を切り替えられるようにしたよ💪
Changes:
- フォームの表示制御を条件描画(
{showForm && ...})からCSS制御(display: none)に変更して、タブ切り替え時のアンマウントを防止 - フォーム初期値の生成をuseMemoでラップして、不要な再生成を抑制
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| user/src/components/Applications/Power/hooks/usePowerApplication.ts | フォーム初期値の生成をuseMemoでメモ化し、hasExistingとdevicesが変更された時のみ再生成するように最適化 |
| user/src/components/Applications/Power/components/PowerFormView.tsx | 条件描画からstyleプロパティでのdisplay制御に変更し、フォームのアンマウントを防止 |
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.
対応Issue
resolve #1973
概要
実装詳細
画面スクリーンショット等
テスト項目
備考