JedWatson / react-select

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

Nested dropdown in menu is not scrollable #5800

Open Novica19 opened 8 months ago

Novica19 commented 8 months ago

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

jamir0 commented 6 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>
  );
};