Skip to content

chore: updates to support new CSS - #1

Merged
GAUNSD merged 1 commit into
GAUNSD:gmurcia/modal-backdrop-animationsfrom
mcoker:modal-backrop-animations-coker
Sep 21, 2026
Merged

GAUNSD merged 1 commit into
GAUNSD:gmurcia/modal-backdrop-animationsfrom
mcoker:modal-backrop-animations-coker

Conversation

@mcoker

@mcoker mcoker commented Sep 8, 2026 •

Copy link
Copy Markdown

Hey! I added CSS support for the backdrop and modal animations, and did so working off of this branch. Here are the changes I made to get it working. Some helpful links:

The core PR with the CSS changes: patternfly/patternfly#8584
The parent PR this PR is against: patternfly#12552

Primarily I changed the modal and backdrop back to conditionally rendering, since I'm not sure if always rendering them in the DOM might create some sort of z-index/stacking order issues.

One question is about the backdrop component. Backdrop doesn't have the equivalent of modal's isOpen, so we/users must be dynamically rendering the component, which means everyone will need to hook into the transitionEnd event (or set a manual setTimeout() or whatever) to allow the backdrop's hide/close animation to finish before unmounting. I wonder if it should have something like that? Not as a part of this feature, but in the future to make the backdrop more flexible.

@GAUNSD GAUNSD left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @mcoker! Changes look good!

@GAUNSD
GAUNSD merged commit cf29347 into GAUNSD:gmurcia/modal-backdrop-animations Sep 21, 2026
2 checks passed
GAUNSD added a commit that referenced this pull request Sep 29, 2026
* feat(Modal,Backdrop): Add animation support

[WIP] This is an initial and in-progress implementation of Modal and
Backdrop animation support.

These changes were cherry-picked (file-level) from branch
gmurcia/tearsheet, originating from the following commits:
  - c027e56 chore: Initial modal/backdrop animation impl
  - 1927470 chore: Animation tweaks.
  - a7f4102 chore: Implement TearsheetGroup for unbounded tearsheet levels

Commit-generated-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>

* refactor: Previous ad-hoc animation impl now aligns with standard PF AnimationsProvider + hooks

Replace custom `animated` prop with `hasAnimations` across Modal,
ModalContent, ModalBox, and Backdrop. Wire up `useHasAnimations` hook
in ModalContent and Backdrop so both participate in AnimationsProvider
context. Add second example demonstrating the AnimationsProvider path.

Generated-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>

* chore: Cleanup

* chore: PR feedback

- Add missing onClose handler to ModalAnimated example
- Add missing onClose handler to ModalAnimatedProvider example

Generated-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>

* chore: PR feedback

* chore: PR feedback

* chore: updates to support new CSS (#1)

* chore: Update to @patternfly/patternfly@npm:6.6.0-prerelease.44

* fix(Backdrop): Default isVisible to true for standalone backdrops.

Generated-by: GPT-5.6 Sol <[email protected]>
Co-authored-by: GPT-5.6 Sol <[email protected]>

* fix(ModalContent): Hide the dialog during its closing transition.

Generated-by: GPT-5.6 Sol <[email protected]>
Co-authored-by: GPT-5.6 Sol <[email protected]>

* fix(ModalContent): Complete the close without transitionend when reduced motion is active

Generated-by: GPT-5.6 Sol <[email protected]>
Co-authored-by: GPT-5.6 Sol <[email protected]>

* refactor(Modal): Enable animations on by default

Generated-by: GPT-5.6 Sol <[email protected]>
Co-authored-by: GPT-5.6 Sol <[email protected]>

* removed the reduced-motion shortcut that immediately unmounted closing modals. Modals now remain mounted until the backdrop transition ends, with a 300ms fallback

Generated-by: GPT-5.6 Sol <[email protected]>
Co-authored-by: GPT-5.6 Sol <[email protected]>

* chore: Add disabled animations modal example

* chore: Remove unnecessary styles (PR feedback)

Update packages/react-core/src/components/Modal/ModalBox.tsx

From: @mcoker

From: @

Co-authored-by: Michael Coker <[email protected]>

* chore: Remove unnecessary styles

* chore: Remove unnecessary Modal doc example (PR review)

* chore: Remove unnecessary Modal doc example (PR review)

* chore: Update doc to reflect rendering recommendation (PR review)

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Michael Coker <[email protected]>
Co-authored-by: GPT-5.6 Sol <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants