JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.63k stars 4.13k forks source link

Nested dropdown in menu is not scrollable #5800

Open Novica19 opened 1 year ago

Novica19 commented 1 year ago

When creating a custom menuList and placing a simple dropdown within it, the dropdown does not respond to mouse scrolling (onWheel)

jamir0 commented 10 months ago

Hi, I have the same issue and fixed my case with this:

const MenuList = <
  Option extends BaseOption,
  IsMulti extends boolean,
  Group extends GroupBase<Option>
>(props: MenuListProps<Option, IsMulti, Group>) => {
  const {
    children,
    isMulti,
    className,
    innerProps
  } = props;

  return (
    <div
      data-role="menuList"
      onScroll={innerProps.onScroll} // <-- here
      className={classNames(
        styles['select-menu-list'],
        {
          'menu-list': true,
          'menu-list--is-multi': isMulti
        },
        className
      )}
    >
      {children}
    </div>
  );
};