Skip to content

fix(QExpansionItem): switch-toggle-side colors are now correct#18250

Open
Jadu07 wants to merge 1 commit intoquasarframework:devfrom
Jadu07:fix/expansion-item-switch-toggle-side-colors
Open

fix(QExpansionItem): switch-toggle-side colors are now correct#18250
Jadu07 wants to merge 1 commit intoquasarframework:devfrom
Jadu07:fix/expansion-item-switch-toggle-side-colors

Conversation

@Jadu07
Copy link
Copy Markdown
Contributor

@Jadu07 Jadu07 commented Mar 17, 2026

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Documentation
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on an Electron app
  • Any necessary documentation has been added or updated in the docs or explained in the PR's description.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to start a new feature discussion first and wait for approval before working on it)

Other information:

When using switch-toggle-side on QExpansionItem with an :icon prop, the icon turns grey and the expand arrow turns black — the opposite of expected.

The side/avatar props on the icon's QItemSection were inverted in getHeaderChild():

// ui/src/components/expansion-item/QExpansionItem.js
- side: props.switchToggleSide === true,
- avatar: props.switchToggleSide !== true
+ side: props.switchToggleSide !== true,
+ avatar: props.switchToggleSide === true

This restores the correct colours: icon stays full-colour (avatar), expand arrow stays secondary/grey (side), regardless of which side they're on.

closes #18008

@github-actions
Copy link
Copy Markdown

UI Tests Results

    1 files     98 suites   40s ⏱️
1 031 tests 1 031 ✅ 0 💤 0 ❌
1 050 runs  1 050 ✅ 0 💤 0 ❌

Results for commit 7da2387.

@IceIsFrozen
Copy link
Copy Markdown

IceIsFrozen commented Mar 20, 2026

Here's the original problem:

image

The suggested change you made breaks original and switched versions as seen during testing. The original has no solid color and the switched has two bolded. An indentation issue also appears with the change.

image

If you utilize the PR suggested earlier that covers both scenarios to get the desired results.

image

@Jadu07 Jadu07 force-pushed the fix/expansion-item-switch-toggle-side-colors branch 2 times, most recently from ebe4834 to 624c541 Compare March 20, 2026 19:42
When using switch-toggle-side on QExpansionItem with an :icon prop, the
icon was turning grey and the expand arrow was turning black — the opposite
of the expected behavior (quasarframework#18008).

Root cause: QItem.sass applies `color: $grey-7` to all `--side` sections
generically. When switchToggleSide is off the arrow's QItemSection uses
`side=true`; when switched on it uses `avatar=true`. Swapping those JS
props (as attempted in the previous commit) broke layout indentation and
min-width because `avatar`/`side` control geometry, not just color.

Fix: CSS-only approach using :has() selectors in QExpansionItem.sass:
- The avatar section wrapping the toggle icon is forced to $grey-7 (grey)
- The side section wrapping a regular icon is forced to inherit color (full)

This fixes colors without touching the JS layout props whatsoever, so
indentation, min-width, and padding remain correct in all configurations.

Closes quasarframework#18008
@Jadu07 Jadu07 force-pushed the fix/expansion-item-switch-toggle-side-colors branch from 624c541 to b91be6c Compare March 20, 2026 19:42
@Jadu07
Copy link
Copy Markdown
Contributor Author

Jadu07 commented Mar 20, 2026

@IceIsFrozen Thanks for pointing that out! The layout issue happened because the JS props were changed.

I’ve reverted the .js changes and pushed a CSS-only fix (QExpansionItem.sass). It swaps the colors using :has() without affecting the layout, so the indentation stays correct.

@Jadu07
Copy link
Copy Markdown
Contributor Author

Jadu07 commented Mar 23, 2026

@rstoenescu @yusufkandemir pls review this pr

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.

When using q-expansion-item with switch-toggle-side colors aren't switched

2 participants