Component
TagPicker
Package version
9.73.7
React version
18.3.1
Environment
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
npmPackages:
@fluentui/react-components: ^9.0.0 => 9.73.7
@types/react: ^17 => 17.0.91
@types/react-dom: ^17 => 17.0.26
react: ^18 => 18.3.1
react-dom: ^18 => 18.3.1
Current Behavior
When a TagPicker with open={true} is rendered inside a Dialog, the dropdown list appears misaligned on the second and subsequent dialog opens. The dropdown is offset from the input by approximately 40px horizontally and 21px vertically.
This occurs because the Dialog component animates its DialogSurface on open using the Web Animations API (250ms duration). When the TagPicker dropdown is forced open immediately (e.g., to show pre-loaded suggestions), Fluent's positioning library calculates the dropdown's transform: translate3d(...) coordinates using the DialogSurface's mid-animation getBoundingClientRect() values. The position is never recalculated after the animation settles.
The first dialog open is typically unaffected because data has not been cached yet — by the time suggestions load, the animation has completed. On subsequent opens, cached data causes the dropdown to render instantly while the animation is still in progress.
Expected Behavior
The TagPicker dropdown should appear correctly aligned with the input regardless of whether the parent Dialog is animating. Either:
- The positioning library should recalculate after ancestor animations complete
- The positioning should account for in-progress animations on ancestor elements
- The
Dialog component should expose a callback or state indicating when its entry animation has finished, allowing consumers to defer rendering positioned content
Reproduction
https://stackblitz.com/edit/s61l7p9p?file=src%2Fexample.tsx
Steps to reproduce
- Open the reproduction
- Click "Open dialog" — the
TagPicker dropdown appears inside the dialog with options listed. On the first open, the dropdown is correctly aligned (data was not cached yet, so it loads after the animation completes).
- Close the dialog
- Click "Open dialog" again — the dropdown is now misaligned, shifted to the right and below the input. This is because the options are already cached and render instantly, before the
DialogSurface's 250ms entry animation finishes.
- Close and reopen — the misalignment persists on every subsequent open.
Are you reporting an Accessibility issue?
no
Suggested severity
Urgent - No workaround and Products/sites are affected
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
Component
TagPicker
Package version
9.73.7
React version
18.3.1
Environment
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh npmPackages: @fluentui/react-components: ^9.0.0 => 9.73.7 @types/react: ^17 => 17.0.91 @types/react-dom: ^17 => 17.0.26 react: ^18 => 18.3.1 react-dom: ^18 => 18.3.1Current Behavior
When a
TagPickerwithopen={true}is rendered inside aDialog, the dropdown list appears misaligned on the second and subsequent dialog opens. The dropdown is offset from the input by approximately 40px horizontally and 21px vertically.This occurs because the
Dialogcomponent animates itsDialogSurfaceon open using the Web Animations API (250ms duration). When theTagPickerdropdown is forced open immediately (e.g., to show pre-loaded suggestions), Fluent's positioning library calculates the dropdown'stransform: translate3d(...)coordinates using theDialogSurface's mid-animationgetBoundingClientRect()values. The position is never recalculated after the animation settles.The first dialog open is typically unaffected because data has not been cached yet — by the time suggestions load, the animation has completed. On subsequent opens, cached data causes the dropdown to render instantly while the animation is still in progress.
Expected Behavior
The
TagPickerdropdown should appear correctly aligned with the input regardless of whether the parentDialogis animating. Either:Dialogcomponent should expose a callback or state indicating when its entry animation has finished, allowing consumers to defer rendering positioned contentReproduction
https://stackblitz.com/edit/s61l7p9p?file=src%2Fexample.tsx
Steps to reproduce
TagPickerdropdown appears inside the dialog with options listed. On the first open, the dropdown is correctly aligned (data was not cached yet, so it loads after the animation completes).DialogSurface's 250ms entry animation finishes.Are you reporting an Accessibility issue?
no
Suggested severity
Urgent - No workaround and Products/sites are affected
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations