-
-
Notifications
You must be signed in to change notification settings - Fork 143
スマホ版で入力フォームがずれる不具合があったので修正 #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ウォークスルーこのプルリクエストは、メッセージ入力コンポーネントとホームページのスタイリングに関する変更を含んでいます。 変更点
可能性のある関連PR
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/pages/index.tsx (1)
21-21: モバイルビューポートの高さ制御の改善 👍
min-h-screenからh-[100svh]への変更は適切です。svh(small viewport height)単位を使用することで、モバイルブラウザのツールバーの表示/非表示による画面のちらつきや入力フォームのずれを防ぐことができます。モバイルブラウザでの表示の安定性が向上し、ユーザー体験が改善されます。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/messageInput.tsx(2 hunks)src/pages/index.tsx(1 hunks)
🔇 Additional comments (2)
src/components/messageInput.tsx (2)
54-56: フォーカス制御の改善 👍
タッチデバイスでのフォーカス制御を適切に実装されています。これにより、モバイルデバイスで不要な仮想キーボードの表示を防ぎ、ユーザー体験が向上します。
140-140: イベントハンドラの簡素化 👍
handleSendClickメソッドを削除し、直接onClickSendButtonを使用する変更は、コードの可読性と保守性を向上させています。
src/components/messageInput.tsx
Outdated
| const isTouchDevice = | ||
| 'ontouchstart' in window || | ||
| navigator.maxTouchPoints > 0 || | ||
| // @ts-ignore | ||
| navigator.msMaxTouchPoints > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
タッチデバイス検出のコードを改善しましょう
現在の実装には以下の改善点があります:
@ts-ignoreの使用は避けるべきです- ブラウザ互換性の考慮が必要です
以下のように改善することを提案します:
- const isTouchDevice =
- 'ontouchstart' in window ||
- navigator.maxTouchPoints > 0 ||
- // @ts-ignore
- navigator.msMaxTouchPoints > 0
+ const isTouchDevice = () => {
+ if (typeof window === 'undefined') return false;
+ return (
+ 'ontouchstart' in window ||
+ navigator.maxTouchPoints > 0 ||
+ // @ts-expect-error: msMaxTouchPoints is IE-specific
+ navigator.msMaxTouchPoints > 0
+ );
+ };📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const isTouchDevice = | |
| 'ontouchstart' in window || | |
| navigator.maxTouchPoints > 0 || | |
| // @ts-ignore | |
| navigator.msMaxTouchPoints > 0 | |
| const isTouchDevice = () => { | |
| if (typeof window === 'undefined') return false; | |
| return ( | |
| 'ontouchstart' in window || | |
| navigator.maxTouchPoints > 0 || | |
| // @ts-expect-error: msMaxTouchPoints is IE-specific | |
| navigator.msMaxTouchPoints > 0 | |
| ); | |
| }; |
スマホ版で入力フォームがずれる不具合があったので修正
Summary by CodeRabbit
新機能
スタイル
<div>のスタイルが変更され、固定のビューポート高さ(100svh)に設定されました。