You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduces new properties to cds-overflow-menu-body: menuOffset and menuOffsetFlip. Updates position calculations in floating-menu.ts, and adds menuOffset usage to the overflowmenu in cds-breadcrumb-item
(In React): Addressed an eslint-disable comment in OverflowMenu.tsx by removing the unused variable menuHeight, and updated the description of menuOffsetFlip to be more specific
Added menuOffset handling in floating-menu.ts
New types, MenuOffset, MenuDirection, etc. that match React's
New functions resolveOffset(), getMenuOffset(), etc. that match the behaviour of the React implementation
Refactored the get position() function to behave exactly like React
Added menuOffset and menuOffsetFlip properties to cds-overflow-menu-body
cds-overflow-menu-body overrides the getOffsetConfig from floating-menu and leaves the rest of the implementation to floating-menu.
Changed
Updated cds-breadcrumb-item to use a menuOffset on its overflow menu
Removed
Removed some rtl related code in floating-menu.ts that was flipping the menuOffset when in rtl which was messing with the semantics, (left would turn into right)
Testing / Reviewing
Go to Breadcrumb/Breadcrumb With Overflow Menu story in WC storybook
The menuOffset should match the React version of this story in both ltr and rtl
There should be no regressions to floating-menu nor overflow-menu-body
Feel free to pull this PR down and try out different menuOffset values, they should visually match the React counterpart
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
Reviewed every line of the diff
Updated documentation and storybook examples
[ ] Wrote passing tests that cover this change
Addressed any impact on accessibility (a11y)
Tested for cross-browser consistency
Validated that this code is ready for review and status checks should pass
❌ Patch coverage is 71.77033% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.16%. Comparing base (0e65384) to head (46e3035).
❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
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
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.
Closes #21512
Introduces new properties to
cds-overflow-menu-body:menuOffsetandmenuOffsetFlip. Updates position calculations infloating-menu.ts, and addsmenuOffsetusage to the overflowmenu incds-breadcrumb-itemThis property can be used as a:
Static Object:
or a
Function
Changelog
New
(In React): Addressed an
eslint-disablecomment inOverflowMenu.tsxby removing the unused variablemenuHeight, and updated the description ofmenuOffsetFlipto be more specificAdded
menuOffsethandling infloating-menu.tsMenuOffset, MenuDirection, etc.that match React'sresolveOffset(), getMenuOffset(), etc.that match the behaviour of the React implementationget position()function to behave exactly like ReactAdded
menuOffsetandmenuOffsetFlipproperties tocds-overflow-menu-bodycds-overflow-menu-bodyoverrides thegetOffsetConfigfromfloating-menuand leaves the rest of the implementation tofloating-menu.Changed
cds-breadcrumb-itemto use amenuOffseton its overflow menuRemoved
rtlrelated code infloating-menu.tsthat was flipping the menuOffset when inrtlwhich was messing with the semantics, (left would turn into right)Testing / Reviewing
Breadcrumb/Breadcrumb With Overflow Menustory in WC storybookltrandrtlfloating-menunoroverflow-menu-bodyPR Checklist
As the author of this PR, before marking ready for review, confirm you:
[ ] Wrote passing tests that cover this change