Repository navigation
feat(side-sheet): add disableResize prop to hide the drag handle - #3417
Conversation
🦋 Changeset detectedLatest commit: 5d660e8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Both failing checks appear unrelated to this PR: |
|
@EdwardBrunton, Thanks for the pr. Could you remove DISABLE_ALL_HANDLES and pass false to the enable prop when resizing is disabled? enable={disableResize ? false : undefined}Also, could you add a separate disableResize story to demonstrate this behavior and remove the disableResize prop from the basic story? That keeps the basic example focused on the default behavior. |
Done 😁 |
- pass false instead of a DISABLE_ALL_HANDLES object to the enable prop - add a dedicated disableResize story and keep the basic story unchanged
10bd1f9 to
da365bf
Compare
|
thank you @EdwardBrunton for the contribution. |
What
Adds an optional
disableResizeprop toSideSheet/SideSheetBasethat hides the drag-to-resize handle. Defaults tofalse, so existing behavior is unchanged unless a consumer opts in.Why
We're toggling the side sheet's width programmatically between two fixed sizes, and leaving the drag handle enabled let manual drags desync from that state. Hiding the handle avoids the desync entirely.
Changes
packages/side-sheet/src/components/SideSheetBase.tsx: newdisableResize?: booleanprop (defaultfalse); whentrue, passes aDISABLE_ALL_HANDLESobject tore-resizable'senableprop instead ofundefined, which otherwise preservesre-resizable's original default (all 8 directions enabled) exactly as before.storybook/src/stories/sidesheet/side-sheet.stories.tsx: added adisableResizeboolean control to thebasicstory for manual testing.minorbump of@equinor/fusion-react-side-sheet.Testing
bun run --filter @equinor/fusion-react-side-sheet buildandlintpass.disableResizeshows/hides the drag handle with no change to default behavior.