-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Fix missing menu border padding #11782
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
Closed
abdulrahmancodes
wants to merge
17
commits into
twentyhq:main
from
abdulrahmancodes:fix/missing-menu-bottom-padding
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3ba12e4
fix missing border padding by adjusting ScrollWrapper and container p…
abdulrahmancodes 23e8b9c
fix(front): simplify component and fix regression
prastoin d7179d7
chore(front): naming
prastoin 7cc11fb
fix lint errors
abdulrahmancodes 084f962
refactor(DropdownMenu): enhance padding and structure of scroll wrapper
abdulrahmancodes 9ac568b
refactor(front): DropDownMenuItemsScrollContainer
prastoin 9508421
fix missing border padding by adjusting ScrollWrapper and container p…
abdulrahmancodes affa6d8
fix(front): simplify component and fix regression
prastoin 7919844
chore(front): naming
prastoin a5e5134
fix lint errors
abdulrahmancodes 978ad8b
refactor(DropdownMenu): enhance padding and structure of scroll wrapper
abdulrahmancodes fc6d311
refactor(front): DropDownMenuItemsScrollContainer
prastoin 2c94577
fix(front): scrollbar padding
prastoin a05de70
lint: fix
prastoin 5699088
comment container scroll what could be root cause
prastoin bce19f4
Merge branch 'fix/missing-menu-bottom-padding' of https://github.com/…
abdulrahmancodes 8c9fb00
fix: enable scrolling in DropDownMenuItemsScrollContainer by adding o…
abdulrahmancodes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...enty-front/src/modules/ui/layout/dropdown/components/DropDownMenuItemsScrollContainer.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper'; | ||
| import styled from '@emotion/styled'; | ||
| import { PropsWithChildren, useId } from 'react'; | ||
|
|
||
| const StyledScrollWrapper = styled(ScrollWrapper)` | ||
| box-sizing: border-box; | ||
| padding-inline: ${({ theme }) => theme.spacing(1)}; | ||
| width: 100%; | ||
| `; | ||
|
|
||
| const StyledPaddingContainer = styled.div` | ||
| padding: ${({ theme }) => theme.spacing(1)}; | ||
| `; | ||
|
|
||
| const StyledPaddingBlockContainer = styled.div` | ||
| overflow: auto; | ||
| padding-block: ${({ theme }) => theme.spacing(1)}; | ||
| `; | ||
|
|
||
| type DropDownMenuItemsScrollContainerProps = PropsWithChildren<{ | ||
| hasMaxHeight?: boolean; | ||
| scrollable?: boolean; | ||
| }>; | ||
| export const DropDownMenuItemsScrollContainer = ({ | ||
| hasMaxHeight = false, | ||
| scrollable = true, | ||
| children, | ||
| }: DropDownMenuItemsScrollContainerProps) => { | ||
| const id = useId(); | ||
|
|
||
| if (scrollable || hasMaxHeight) { | ||
| return ( | ||
| <StyledPaddingBlockContainer> | ||
| <StyledScrollWrapper | ||
| componentInstanceId={`scroll-wrapper-dropdown-menu-${id}`} | ||
| > | ||
| {children} | ||
| </StyledScrollWrapper> | ||
| </StyledPaddingBlockContainer> | ||
| ); | ||
| } | ||
|
|
||
| return <StyledPaddingContainer>{children}</StyledPaddingContainer>; | ||
| }; | ||
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
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.
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.
Open question: Not sure why this is required here but it is, not getting globally applied from the index.css