feat(react-positioning): add placement to onPositioningEnd event#35773
Merged
robertpenner merged 7 commits intomicrosoft:masterfrom Feb 23, 2026
Merged
feat(react-positioning): add placement to onPositioningEnd event#35773robertpenner merged 7 commits intomicrosoft:masterfrom
robertpenner merged 7 commits intomicrosoft:masterfrom
Conversation
The onPositioningEnd callback now receives a CustomEvent with detail.placement containing the computed Floating UI placement. This enables consumers (e.g. react-popover motion) to react to the final placement after flip/shift middleware adjustments. - Define PositioningPlacement as a Fluent-owned string union equivalent to Floating UI's Placement, avoiding leaking @floating-ui/dom types into the public API surface - Add OnPositioningEndEventDetail and OnPositioningEndEvent types - Thread the event through createPositionManager and usePositioning
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
packages/react-components/react-positioning/library/src/createPositionManager.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-positioning/library/src/usePositioning.test.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/react-positioning/library/src/usePositioning.test.tsx
Outdated
Show resolved
Hide resolved
layershifter
approved these changes
Feb 23, 2026
change/@fluentui-react-positioning-9523f0c2-c54d-4461-81db-52c268453586.json
Show resolved
Hide resolved
a92822b to
d1682ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The
onPositioningEndcallback now receives aCustomEventwithdetail.placementcontaining the computed Floating UI placement. This enables consumers (e.g. react-popover motion migration) to react to the final placement after flip/shift middleware adjustments.Changes
types.ts: DefinePositioningPlacementas a Fluent-owned string union equivalent to Floating UI'sPlacementtype, avoiding leaking@floating-ui/dominto the public API surface. AddOnPositioningEndEventDetailandOnPositioningEndEventtypes.createPositionManager.ts: Dispatchfui-positioningendevent with{ detail: { placement } }after positioning completes.usePositioning.ts: Forward the typed event through theonPositioningEndcallback.API Surface
react-positioning.api.md).index.ts; they are reachable through the existingPositioningPropstype.Backwards Compatibility
onPositioningEndcallback signature changed from() => voidto(e: OnPositioningEndEvent) => void.onPositioningEndinapps/vr-tests-react-components/src/stories/Positioning/Positioning.stories.tsx, and it remains free of type errors.Testing
createPositionManager.test.ts(new, 14 tests) — detail.placement for all 12 placements, middleware adjustments, no dispatch after dispose.usePositioning.test.tsx(new, 3 tests) — callback receives event, no error when omitted,() => voidbackwards compat.types.test.ts(2 new tests) — both() => voidand(e: OnPositioningEndEvent) => voidaccepted.Future Work
react-popoverfrom CSS animations (createSlideStyles) to Fluent motion components.