Repository navigation
feat!: replace Popper with Floating UI - #3
Merged
Merged
Conversation
Pages can't be published for this repo; docs run locally via `npm start`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@popperjs/core is unmaintained since 2023. Tooltip, Popover and DropdownMenu now call `useFloating` from @floating-ui/react-dom directly; the react-popper style `popper.tsx` shim is gone. BREAKING CHANGE: `PopperContent` → `FloatingContent`, `popperClassName` → `floatingClassName`, `modifiers` → `middleware`, `boundariesElement` → `boundary`, `offset` takes Floating UI `OffsetOptions` (Popover default 8). `data-popper-reference-hidden` and `Util.PopperPlacements` are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Same-named user middleware replaces the default in its slot (a custom `offset` now runs before flip/shift); falsy entries are skipped. - `shift` uses `limitShift()`, matching Popper's `preventOverflow` tether. - `auto-start`/`auto-end` keep their alignment (`autoAlignment: false`). - DropdownToggle re-applies a swapped `innerRef`. - Tests for order, tether, arrow positioning, updateOnSelect, toggle reference and innerRef; CHANGELOG gaps filled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Replaces
@popperjs/core, which has had no release since 2023, with Floating UI (@floating-ui/react-dom). Bootstrap 6 makes the same move.There is no Popper-shaped shim:
src/popper.tsx(react-popper'sManager/Reference/PopperAPI) is deleted, and components calluseFloatingdirectly.FloatingContent, which replacesPopperContent, positions Tooltip and Popover withoffset, thenfliporautoPlacement, thenshiftandarrow.DropdownMenufloats against the toggle element, whichDropdownnow keeps in state and shares through context, usingflipandshift.data-popper-placement, and the menu still getsdata-bs-popper. These attributes are Bootstrap 5's CSS hooks, not Popper's.Also removes
docs.yml: GitHub Pages can't be published here.Breaking (11.0.0)
PopperContent,PopperContentPropsFloatingContent,FloatingContentProps(+FloatingPlacement)popperClassNamefloatingClassNamemodifiers(Popper modifiers)middleware(Floating UI; same-named entries replace defaults)offset={[skid, dist]}OffsetOptions:8, or{ mainAxis, crossAxis }. Popover default8boundariesElementboundary(default'clippingAncestors')data-popper-reference-hidden,Util.PopperPlacementsplacement="auto*"still works, viaautoPlacement. Fix:DropdownToggle'sinnerRefwas dropped inside a navbar and now works there too.ConCat needs one line changed:
PopperContent.defaultProps.offset = [0, 5]becomesFloatingContent.defaultProps.offset = 5.Test plan
npm run typecheck,lint,format:checknpm run test:ci: 850 tests. AuseFloatingspy (real implementation) replaces the Popper mock.npm run build:@floating-ui/react-domis the only positioning dependency; nopopperjsindist/npm run build:docsmaster(Popper) and this branch, comparing the measured placement and the box sizes and positions of the floating element and its arrow. Covered: tooltip, popover and dropdown stories (directions, auto, flip). Every case matches except one 1px sub-pixel rounding difference on a left tooltip.🤖 Generated with Claude Code