fix(spindle-ui): スマホ幅の時にSemiModalコンテンツ領域がスクロールバー分寄っている #1358
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.
SemiModal利用時に、SP幅の表示の際、コンテンツ領域が若干左寄りになっているのを修正しました。
対応方針
現状のPC幅の実装を見ると、スクロールバーの幅分右paddingを調整している↓ようだったので、SP幅もそれに倣ってpaddingを調整しました。
https://github.com/openameba/spindle/blob/main/packages/spindle-ui/src/Modal/SemiModal.css#L139
疑問1:
その他の方法
スクロールバーが不要なときにもスクロールバーの領域(8px)を取る実装になっている↓ので、
https://github.com/openameba/spindle/blob/main/packages/spindle-ui/src/Modal/SemiModal.css#L176
overflow: hidden auto;にすることで、必要な時だけスクロールバーの領域を取るのでも良さそう?ただ、スクロールバーの有無でコンテンツの表示領域にブレが出るのが嫌で現状のpaddingの調整にしているのかなと想像し、選択しませんでした 🙏 もし意図わかる方がいれば 🙏
疑問2:SPのFigmaデザインではそもそもスクロール幅の領域を考慮されていなそう↓なので、こちらの選択肢の方が良いのかも?どうなんでしょう?