Skip to content

fix(drawer): adjust pill for rtl and widths - #7981

Merged
mcoker merged 2 commits into
patternfly:mainfrom
srambach:7947-drawer-pill-rtl
Dec 9, 2025
Merged

mcoker merged 2 commits into
patternfly:mainfrom
srambach:7947-drawer-pill-rtl

Conversation

@srambach

@srambach srambach commented Nov 7, 2025 •

Copy link
Copy Markdown
Member

Fixes #7947
Uses the pill drawer inset to adjust

  • the position of the drawer in RTL (subtract the inset from the translate)
  • the width of the drawer when specified
  • for 100% subtract twice the offset so it's offset on both sides

Formula syntax assisted by Claude code

@patternfly-build

patternfly-build commented Nov 7, 2025 •

Copy link
Copy Markdown
Collaborator

@srambach
srambach requested a review from mcoker November 7, 2025 19:42

@mcoker mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like the reason the inline pill drawer isn't responding to the .pf-m-width modifiers is because this var's value doesn't have a unit and is used in a calc() https://github.com/srambach/patternfly/blob/f14de9bde750ad33ab6217ea8683f216d6d224cb/src/patternfly/components/Drawer/drawer.scss#L218

Also looked at the react component and it sets --pf-v6-c-drawer__panel--md--FlexBasis--min and --pf-v6-c-drawer__panel--md--FlexBasis--max inline via minSize and maxSize props, so a combo of minSize: {some ideal size} and maxSize: 100% is a valid use case. IMO that's more work than this issue needs. The percentage based width classes work and that should be good enough.

I'd be good with a follow-up that looks at what happens when you use --FlexBasis, --FlexBasis--min, and --FlexBasis--max, and also tests resizable since I don't think that's been looked at yet, either. wdyt?

@srambach

Copy link
Copy Markdown
Member Author
  • I put in the 0px so that the calc doesn't fail on the width calculation
  • I removed the conditional to subtract the inset on both sides of the pill drawer
  • I had to remove the drawer gap for inline (pill) drawers - otherwise the drawer was misaligned by that much 😫

@srambach
srambach force-pushed the 7947-drawer-pill-rtl branch from f14de9b to 3c5d99e Compare November 13, 2025 20:59
@srambach
srambach requested a review from mcoker November 19, 2025 19:15

@mcoker mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

L🗃️TM

@mcoker
mcoker merged commit e58ce12 into patternfly:main Dec 9, 2025
4 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.31 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawer - pill variant updates

3 participants