Skip to content

feat(form): add new disableStickyOnSmallScreen prop - FE-7686#8005

Draft
DipperTheDan wants to merge 1 commit into
masterfrom
FE-7686_disableStickyOnSmallScreen-for-form
Draft

feat(form): add new disableStickyOnSmallScreen prop - FE-7686#8005
DipperTheDan wants to merge 1 commit into
masterfrom
FE-7686_disableStickyOnSmallScreen-for-form

Conversation

@DipperTheDan

Copy link
Copy Markdown
Contributor

Ensures that disableStickyOnSmallScreen can work with Form inside of a Dialog with the same prop applied.

fix #7973

Proposed behaviour

Adds a new prop to Form called disableStickyOnSmallScreen that can be used in conjunction with Dialog's prop of the same name to allow Form's to be used in Dialog on a small screen and have the same styling applied.

Current behaviour

disableStickyOnSmallScreen only exists in Dialog so can hinder the flow of Forms in a Dialog.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

  • There should be no functional regressions with Dialog.
  • small-screen-behavior example now includes Form with the disableStickyOnSmallScreen prop. Above 600px the footer should be sticky and below 600px the footer should not be sticky.

Ensures that disableStickyOnSmallScreen can work with Form inside of a Dialog with the same prop
applied.

fix #7973
@DipperTheDan DipperTheDan force-pushed the FE-7686_disableStickyOnSmallScreen-for-form branch from 6a1fbde to ff7ec53 Compare June 8, 2026 15:21
@DipperTheDan DipperTheDan requested a review from Copilot June 12, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a disableStickyOnSmallScreen prop to the Form component so consumers can opt out of the sticky footer behaviour on small screens (to align with Dialog’s small-screen accessibility behaviour when a Form is used inside a Dialog).

Changes:

  • Introduces disableStickyOnSmallScreen?: boolean on FormProps and wires it into StyledFormFooter.
  • Adds responsive styling to unstick the Form footer (position/box-shadow) at max-width: 600px.
  • Updates the Dialog “Small Screen Behavior” Storybook example and adds a unit test for the new styling branch (plus regenerated skills docs).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/form/form.component.tsx Adds the new disableStickyOnSmallScreen prop to FormProps and passes it to the footer styling.
src/components/form/form.style.ts Implements the small-screen media query that disables sticky footer styles when the prop is enabled.
src/components/form/form.test.tsx Adds a styled-components media-query assertion to cover the new styling branch.
src/components/dialog/dialog.stories.tsx Updates the small-screen behavior example to demonstrate a Form using the new prop within a Dialog.
skills/carbon-react/components/form.md Regenerated skills/docs to include the new Form prop.
skills/carbon-react/components/dialog.md Regenerated skills/docs reflecting the updated story example.

Comment on lines +307 to +308
// for coverage - the `disableStickyOnSmallScreen` prop is captured by Chromatic.
test("disables sticky footer unconditionally when `disableStickyOnSmallScreen` and `stickyFooter` are set", () => {
Comment on lines +643 to +645
This improves accessibility on mobile devices. We also have a
`disableStickyOnSmallScreen` prop that means Form can also be used
within a Dialog without a sticky footer on small screen devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Keep stickyFooter and add support for disableStickyOnSmallScreen for <Form>

2 participants