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 for: Chat - New Group - The search box overlays the selected user #14175

Merged
merged 2 commits into from
Jan 10, 2023
Merged
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
2 changes: 1 addition & 1 deletion src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class BaseOptionsSelector extends Component {
focusedIndex: newFocusedIndex,
}, () => {
// If we just toggled an option on a multi-selection page, scroll to top
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we update this comment perhaps?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh yes, we should add more context about the changes.

@Ollyws Can you update the comment there? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done.

if (this.props.selectedOptions.length !== prevProps.selectedOptions.length) {
if (this.props.selectedOptions.length !== prevProps.selectedOptions.length || this.props.value === '') {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change caused The scrollbar automatically scrolls to the top when one of contacts update their display name.
As the comment says, this should be called only when search input is cleared.
So we fixed this condition to !!prevProps.value && !this.props.value

this.scrollToIndex(0);
return;
}
Expand Down