Handsontable v16 dropdown/filter menu positioning issue in React

I created a minimal StackBlitz reproduction for this issue in Handsontable v16 with React.

Problems observed:

  1. With default:
dropdownMenu
={true}
filters={true}

the dropdown/filter menu renders lower in the page instead of near the clicked column header.

  1. Filter conditions are not showing correctly.
    Expected options like:
  • Begins with

  • Contains

  • Equals

  • Greater than
    etc.

But the dropdown appears blank/misaligned.

  1. Entered filter values are also not visible properly inside the filter inputs.

  2. Filter values list at the bottom is also rendering incorrectly.

Environment:

  • React

  • Handsontable v16

  • Scrollable page/container

    Expected:

    • Dropdown/filter menu should open near selected header

    • Filter condition options should display properly

    • Entered filter values should be visible

    • Filter values list should render correctly

    Actual:

    • Menu renders lower in page

    • Filter condition dropdown is blank/misaligned

    • Entered values are not visible correctly

    • Values list renders incorrectly

    StackBlitz reproduction:

    Vitejs - Vite (duplicated) - StackBlitz

Hi @kranthikumar.reddy32 , two small fixes in App.tsx:

The theme is imported but never activated, which is why the conditions list, input text, and values list all render unstyled:

 <HotTable
+  themeName="ht-theme-main"
   data={data}
   ...
 />

The menu opens below the fold because of the scrollable wrapper:

<div style={{ padding: '40px', height: '100vh', overflow: 'auto' }}>

In v16 the dropdown menu positions itself with window.scrollY, which stays at 0 because it’s the inner div that’s scrolling.

Either give the grid its own scroll:

-<div style={{ padding: '40px', height: '100vh', overflow: 'auto' }}>
+<div style={{ padding: '40px' }}>
   <HotTable
+    height={500}
     width="100%"
     ...
   />
 </div>

…or drop height: '100vh' and overflow: 'auto' so the page scrolls on <body> instead.

Hope this help! By the way, your StackBlitz has v17 of Handsontable with the @handsontable/react plugin for v16. If you want to test in v17, the plugin is @handsontable/react-wrapper.

@joseph.petty i updated changes as you suggested but still not working.
can you please update the stalkblitz and provide solution for this.

@aleksandra_budnik can you please support on this

Hi @kranthikumar.reddy32 , I found an existing issue for this:

It’s a tree shaking issue that started with Vite 8’s more aggressive filtering. We have fix already in review here:

In the meantime, you can work around it by disabling tree shaking in vite.config.ts:

optimizeDeps: {
  include: ['handsontable', 'handsontable/base', 'handsontable/registry', '@handsontable/react-wrapper'],
  esbuildOptions: { treeShaking: false },
},

Then rm -rf node_modules/.vite and restart npm run dev so Vite re-bundles with the new config.

@joseph.petty Thanks for the update.

I added the suggested optimizeDeps configuration with treeShaking: false, cleared the .vite cache, and restarted the application.

I’ll verify the behavior and update here with the results.
Understood that this is a temporary workaround until the official fix is released.

Thanks for the support and clarification regarding the Vite 8 tree-shaking issue.

Could you please confirm once the official fix is released so that we can remove this temporary workaround and upgrade accordingly?

Yes, of course! I’m following the issue in GitHub and will update this thread as soon as the fix live.