mantine icon indicating copy to clipboard operation
mantine copied to clipboard

`ComboBox` `onPositionChange` fires after dropdown transition completes

Open pfo-omicsstudio opened this issue 7 months ago • 1 comments

Dependencies check up

  • [x] I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

8.1.3

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Not applicable – issue is not related to the browser

Describe the bug

When using onDropdownPositionChange on a Combobox, the callback is invoked only after the dropdown transition has finished. This makes it impossible to dynamically update the transition’s transform-origin in time for the opening animation.

The issue occurs when switching between two comboboxes that resolve to different dropdown placements. For example:

  1. Open a combobox near the top of the viewport: the dropdown opens downward.
  2. Without closing it manually, open another combobox near the bottom of the viewport — this one opens upward (placement flips to "top").
  3. Although the dropdown visually opens in the correct direction, the animation plays from the previous origin (e.g. top) because onDropdownPositionChange has not yet fired at the time the transition starts.

https://github.com/user-attachments/assets/c8f3e8c7-1504-4682-908b-76eccee6be38

Fortunately, it is fairly trivial to reproduce, so I have included a codesandbox link for this purpose.

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/quirky-hertz-8k8r5g

Possible fix

Make onPositionChange fire immediately instead of delaying it until the transition has completed.

Self-service

  • [ ] I would be willing to implement a fix for this issue

pfo-omicsstudio avatar Jul 08 '25 09:07 pfo-omicsstudio

Currently, no idea if the fix is possible for this

rtivital avatar Oct 02 '25 18:10 rtivital