Adding a position: absolute on the dropdown menu should fix it for you.
Example with React Bootstrap:
<Dropdown.Menu style={{ position: 'absolute' }}>
<Dropdown.Item>
Item 1
</Dropdown.Item>
<Dropdown.Item>
Item 2
</Dropdown.Item>
</Dropdown.Menu>