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(Select): prevent page scrolling after first click #364

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

korvin89
Copy link
Contributor

Closes #362

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -225,5 +225,5 @@ export const getActiveItem = (listRef: React.RefObject<List<FlattenOption>>) =>
export const activateFirstClickableItem = (listRef: React.RefObject<List<FlattenOption>>) => {
const items = getListItems(listRef);
const isGroupTitleFirstItem = items[0] && 'label' in items[0];
listRef?.current?.activateItem(isGroupTitleFirstItem ? 1 : 0);
listRef?.current?.activateItem(isGroupTitleFirstItem ? 1 : 0, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

any chance for test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I`ll add this one later with other base tests

@korvin89 korvin89 merged commit 3320a7e into main Oct 18, 2022
@korvin89 korvin89 deleted the korvin89/issue-30 branch October 18, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select: Page scrolls up after I first time click on select
3 participants