-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[Bug]: Tooltip and Dropdown anchoring not working #36740
Copy link
Copy link
Open
Labels
Area: PositioningComponent: DropdownComponent: TooltipFluent UI WC (v3)Fluent UI Web Component V3Fluent UI Web Component V3Needs: InvestigationThe Shield Dev should investigate this issue and propose a fixThe Shield Dev should investigate this issue and propose a fixType: Bug 🐛web-components
Description
Activity
Metadata
Metadata
Assignees
Labels
Area: PositioningComponent: DropdownComponent: TooltipFluent UI WC (v3)Fluent UI Web Component V3Fluent UI Web Component V3Needs: InvestigationThe Shield Dev should investigate this issue and propose a fixThe Shield Dev should investigate this issue and propose a fixType: Bug 🐛web-components
Type
Projects
- StatusShow more project fieldsNo status
Component
Tooltip
Package version
3.0.1
@microsoft/fast-element version
?
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/web-components: 3.0.1 => 3.0.1Current Behavior
Tooltip and dropdown do not work together. When applying a tooltip to the dropdown the tooltip appears at the top-left of the screen.
I believe the issues is related to the way these two components handle css positioning anchoring. The dropdown will give itself an anchor-name in order to coordinate with the listbox popover:
fluentui/packages/web-components/src/dropdown/dropdown.base.ts
Line 257 in e803348
However, the tooltip also needs a stable anchor name:
fluentui/packages/web-components/src/tooltip/tooltip.ts
Line 111 in e803348
I believe the issue is that the tooltip initializes and captures the current anchor-name, then the dropdown changes it's anchor-name later.
Expected Behavior
The tooltip should be positioned next to the dropdown.
Reproduction
https://stackblitz.com/edit/vitejs-vite-ygrqqvpa
Steps to reproduce
Hover over the dropdown in the example, the tooltip appears in the top-left.
Are you reporting an Accessibility issue?
no
Suggested severity
High - No workaround
Products/sites affected
Fabric UX
Are you willing to submit a PR to fix?
yes
Validations