Skip to content
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: prevent transparent suggestion list by using portal #27771

Merged
merged 5 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove unused props
  • Loading branch information
sangar-1028 committed Sep 19, 2023
commit 341efce627945305f8fe7a66b73c226619043fd9
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ const propTypes = {
* When this value is false, the suggester will have a height of 2.5 items. When this value is true, the height can be up to 5 items. */
isSuggestionPickerLarge: PropTypes.bool.isRequired,

/** Show that we should include ReportRecipientLocalTime view height */
shouldIncludeReportRecipientLocalTimeHeight: PropTypes.bool.isRequired,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-alves10 could you please explain why this isn't needed anymore?

Copy link
Contributor Author

@s-alves10 s-alves10 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rushatgabhane

We use that for calculating the top css here, but in cases using portal, this isn't needed anymore

function getAutoCompleteSuggestionContainerStyle(itemsHeight: number, shouldIncludeReportRecipientLocalTimeHeight: boolean): ViewStyle | CSSProperties {


/** create accessibility label for each item */
accessibilityLabelExtractor: PropTypes.func.isRequired,

Expand Down
4 changes: 0 additions & 4 deletions src/components/EmojiSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ const propTypes = {
* 2.5 items. When this value is true, the height can be up to 5 items. */
isEmojiPickerLarge: PropTypes.bool.isRequired,

/** Show that we should include ReportRecipientLocalTime view height */
shouldIncludeReportRecipientLocalTimeHeight: PropTypes.bool.isRequired,

/** Stores user's preferred skin tone */
preferredSkinToneIndex: PropTypes.number.isRequired,

Expand Down Expand Up @@ -102,7 +99,6 @@ function EmojiSuggestions(props) {
highlightedSuggestionIndex={props.highlightedEmojiIndex}
onSelect={props.onSelect}
isSuggestionPickerLarge={props.isEmojiPickerLarge}
shouldIncludeReportRecipientLocalTimeHeight={props.shouldIncludeReportRecipientLocalTimeHeight}
accessibilityLabelExtractor={keyExtractor}
measureParentContainer={props.measureParentContainer}
/>
Expand Down
4 changes: 0 additions & 4 deletions src/components/MentionSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ const propTypes = {
* When this value is false, the suggester will have a height of 2.5 items. When this value is true, the height can be up to 5 items. */
isMentionPickerLarge: PropTypes.bool.isRequired,

/** Show that we should include ReportRecipientLocalTime view height */
shouldIncludeReportRecipientLocalTimeHeight: PropTypes.bool.isRequired,

/** Meaures the parent container's position and dimensions. */
measureParentContainer: PropTypes.func,
};
Expand Down Expand Up @@ -125,7 +122,6 @@ function MentionSuggestions(props) {
highlightedSuggestionIndex={props.highlightedMentionIndex}
onSelect={props.onSelect}
isSuggestionPickerLarge={props.isMentionPickerLarge}
shouldIncludeReportRecipientLocalTimeHeight={props.shouldIncludeReportRecipientLocalTimeHeight}
accessibilityLabelExtractor={keyExtractor}
measureParentContainer={props.measureParentContainer}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function ComposerWithSuggestions({
setIsFullComposerAvailable,
setIsCommentEmpty,
submitForm,
shouldShowReportRecipientLocalTime,
shouldShowComposeInput,
measureParentContainer,
// Refs
Expand Down Expand Up @@ -503,7 +502,6 @@ function ComposerWithSuggestions({
isComposerFullSize={isComposerFullSize}
updateComment={updateComment}
composerHeight={composerHeight}
shouldShowReportRecipientLocalTime={shouldShowReportRecipientLocalTime}
onInsertedEmoji={onInsertedEmoji}
measureParentContainer={measureParentContainer}
// Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ function ReportActionCompose({
setIsFullComposerAvailable={setIsFullComposerAvailable}
setIsCommentEmpty={setIsCommentEmpty}
submitForm={submitForm}
shouldShowReportRecipientLocalTime={shouldShowReportRecipientLocalTime}
shouldShowComposeInput={shouldShowComposeInput}
onFocus={onFocus}
onBlur={onBlur}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function SuggestionEmoji({
setSelection,
updateComment,
isComposerFullSize,
shouldShowReportRecipientLocalTime,
isAutoSuggestionPickerLarge,
forwardedRef,
resetKeyboardInput,
Expand Down Expand Up @@ -235,7 +234,6 @@ function SuggestionEmoji({
isComposerFullSize={isComposerFullSize}
preferredSkinToneIndex={preferredSkinTone}
isEmojiPickerLarge={isAutoSuggestionPickerLarge}
shouldIncludeReportRecipientLocalTimeHeight={shouldShowReportRecipientLocalTime}
measureParentContainer={measureParentContainer}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function SuggestionMention({
personalDetails,
updateComment,
composerHeight,
shouldShowReportRecipientLocalTime,
forwardedRef,
isAutoSuggestionPickerLarge,
measureParentContainer,
Expand Down Expand Up @@ -284,7 +283,6 @@ function SuggestionMention({
isComposerFullSize={isComposerFullSize}
isMentionPickerLarge={isAutoSuggestionPickerLarge}
composerHeight={composerHeight}
shouldIncludeReportRecipientLocalTimeHeight={shouldShowReportRecipientLocalTime}
measureParentContainer={measureParentContainer}
/>
);
Expand Down
2 changes: 0 additions & 2 deletions src/pages/home/report/ReportActionCompose/Suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function Suggestions({
setSelection,
updateComment,
composerHeight,
shouldShowReportRecipientLocalTime,
forwardedRef,
onInsertedEmoji,
resetKeyboardInput,
Expand Down Expand Up @@ -105,7 +104,6 @@ function Suggestions({
isComposerFullSize,
updateComment,
composerHeight,
shouldShowReportRecipientLocalTime,
isAutoSuggestionPickerLarge,
measureParentContainer,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ const propTypes = {
/** A method to call when the form is submitted */
submitForm: PropTypes.func.isRequired,

/** Whether the recipient local time is shown or not */
shouldShowReportRecipientLocalTime: PropTypes.bool.isRequired,

/** Whether the compose input is shown or not */
shouldShowComposeInput: PropTypes.bool.isRequired,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ const baseProps = {
/** Callback to update the comment draft */
updateComment: PropTypes.func.isRequired,

/** Flag whether we need to consider the participants */
shouldShowReportRecipientLocalTime: PropTypes.bool.isRequired,

/** Meaures the parent container's position and dimensions. */
measureParentContainer: PropTypes.func.isRequired,
};
Expand Down