Skip to content

fix: scroll issue after scrolling and selecting elements #115

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
fix: scroll issue after scrolling and selecting elements
  • Loading branch information
smit95tpatel committed May 5, 2023
commit db7612573cf9eb1003659a422b9db112787318b7
8 changes: 2 additions & 6 deletions src/Options.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React, { Component } from 'react';
import React, { PureComponent } from 'react';
import cx from 'classnames';
import Option from './Option';
import { getOptionIndex, isOptGroup } from './utils';

export default class Options extends Component {
componentWillReceiveProps({ options, highlightedOption }) {
this.scrollTo({ options, highlightedOption });
}

export default class Options extends PureComponent {
componentDidMount() {
let { options, highlightedOption } = this.props;
this.optionsListOffsetHeight = this.optionsList.offsetHeight;
Expand Down