Skip to content

Commit 10f4197

Browse files
fix(avatar): fix avatar disabled for icon content (#30820)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> - When Avatar has an icon as content and is disabled, the icon is above the disabled layer. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - add avatar with icon on disabled state page; - add avatar with icon on snapshots tests; - change disable state to be the :after pseudo element avatar content; ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> [state](https://ionic-framework-git-rou-12319-ionic1.vercel.app/src/components/avatar/test/states?ionic:theme=ionic) --------- Co-authored-by: ionitron <[email protected]>
1 parent 16cbe63 commit 10f4197

File tree

6 files changed

+7
-1
lines changed

6 files changed

+7
-1
lines changed

core/src/components/avatar/avatar.ionic.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244

245245
// Avatar Disabled
246246
// --------------------------------------------------
247-
:host(.avatar-disabled)::before {
247+
:host(.avatar-disabled)::after {
248248
@include globals.border-radius(var(--border-radius));
249249
@include globals.disabled-state();
250250
}

core/src/components/avatar/test/states/avatar.e2e.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screens
1212
`
1313
<div id="container">
1414
<ion-avatar disabled> AV </ion-avatar>
15+
<ion-avatar disabled>
16+
<ion-icon name="person-outline"></ion-icon>
17+
</ion-avatar>
1518
<ion-avatar disabled>
1619
<img src="/src/components/avatar/test/avatar.svg" />
1720
</ion-avatar>
1.23 KB
Loading
1.62 KB
Loading
1.3 KB
Loading

core/src/components/avatar/test/states/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<ion-content>
2626
<h3>Disabled</h3>
2727
<ion-avatar disabled>AV</ion-avatar>
28+
<ion-avatar disabled>
29+
<ion-icon name="person-outline"></ion-icon>
30+
</ion-avatar>
2831
<ion-avatar disabled>
2932
<img src="/src/components/avatar/test/avatar.svg" />
3033
</ion-avatar>

0 commit comments

Comments
 (0)