-
Notifications
You must be signed in to change notification settings - Fork 0
fix: horizontal scroll for suggestion chips on mobile #26
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,14 +9,21 @@ interface SuggestionChipsProps { | |||||
|
|
||||||
| export function SuggestionChips({ options, onSelect, className }: SuggestionChipsProps) { | ||||||
| return ( | ||||||
| <div className={cn('flex flex-wrap gap-2', className)}> | ||||||
| <div | ||||||
| className={cn( | ||||||
| 'flex gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-hide', | ||||||
| // Wrap on desktop, scroll on mobile | ||||||
| 'sm:flex-wrap', | ||||||
|
||||||
| 'sm:flex-wrap', | |
| 'md:flex-wrap', |
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.
The negative margin pattern (
pb-1 -mb-1) is used to hide the scrollbar space, but this approach can be fragile and may cause layout issues with parent containers. Consider usingoverflow-x-auto scrollbar-hidewithout the padding/margin trick, as thescrollbar-hideclass should already handle hiding the scrollbar without requiring layout adjustments.