-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: show large suggestion menu only if there is space #28927
Changes from 1 commit
4d5e108
54fa3c9
342c592
c1e5a56
477a03e
d14442a
af47c4c
32d8147
410ae8c
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 |
---|---|---|
|
@@ -156,6 +156,7 @@ function ReportScreen({ | |
const prevReport = usePrevious(report); | ||
const prevUserLeavingStatus = usePrevious(userLeavingStatus); | ||
const [isBannerVisible, setIsBannerVisible] = useState(true); | ||
const [listHeight, setListHeight] = useState(0); | ||
|
||
const reportID = getReportID(route); | ||
const {addWorkspaceRoomOrChatPendingAction, addWorkspaceRoomOrChatErrors} = ReportUtils.getReportOfflinePendingActionAndErrors(report); | ||
|
@@ -343,7 +344,8 @@ function ReportScreen({ | |
} | ||
}, [report, didSubscribeToReportLeavingEvents, reportID]); | ||
|
||
const onListLayout = useCallback(() => { | ||
const onListLayout = useCallback((e) => { | ||
setListHeight((prev) => lodashGet(e, 'nativeEvent.layout.height', prev)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is the most interesting part that wasn't present in the proposal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. There are some places where we also show a |
||
if (!markReadyForHydration) { | ||
return; | ||
} | ||
|
@@ -430,6 +432,7 @@ function ReportScreen({ | |
isComposerFullSize={isComposerFullSize} | ||
onSubmitComment={onSubmitComment} | ||
policies={policies} | ||
listHeight={listHeight} | ||
/> | ||
) : ( | ||
<ReportFooter shouldDisableCompose /> | ||
|
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.
This value has to be kept in sync with something, right?
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.
Hm... Yes. This is actually the space which is below the composer. It consists of padding and margin as well. That is why I did not use it directly.
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.
Okay. Handled what you wanted!
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.
I didn't have any solution in mind yet. Sometimes, a comment like "This has to be kept in sync with..." can work. I'll see what you figured out in a moment.