Skip to content

Commit 45639c9

Browse files
refactor(chip): fix the selected transition (#14867)
Co-authored-by: Marin Popov <[email protected]>
1 parent e428829 commit 45639c9

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@
255255
/// @param {Map} $theme - The theme used to style the component.
256256
@mixin chip($theme) {
257257
@include css-vars($theme);
258-
$transition: all 120ms $in-out-quad;
259258
$chip-max-width: 32ch;
260259

261260
$variant: map.get($theme, '_meta', 'variant');
@@ -308,17 +307,10 @@
308307
position: relative;
309308
display: inline-flex;
310309
flex-shrink: 0;
311-
transition: $transition;
312-
transition-property: top, left;
313310

314311
// Fix: The grid resizing does not autosize the filter header cells with the default filter chips
315312
// https://github.com/IgniteUI/igniteui-angular/pull/12770/files/efd2a274038c051e82561903f8799fd03265fd74#r1150993630
316313
min-width: max-content;
317-
318-
[dir='rtl'] & {
319-
transition-property: top right;
320-
}
321-
322314
touch-action: none;
323315
outline: none;
324316

@@ -336,7 +328,6 @@
336328
color: var-get($theme, 'focus-selected-text-color');
337329
background: var-get($theme, 'focus-selected-background');
338330
border-color: var-get($theme, 'focus-selected-border-color');
339-
transition: $transition;
340331
box-shadow: $box-shadow-focus-selected;
341332
}
342333
}
@@ -377,10 +368,7 @@
377368
user-select: none;
378369
overflow: hidden;
379370
cursor: pointer;
380-
// hacking `overflow: hidden` with border radius
381-
// not playing nicely together
382371
filter: opacity(1);
383-
// transition: all 120ms ease-in;
384372

385373
igx-avatar {
386374
display: flex !important;
@@ -424,7 +412,6 @@
424412
color: var-get($theme, 'selected-text-color');
425413
background: var-get($theme, 'selected-background');
426414
border-color: var-get($theme, 'selected-border-color');
427-
transition: $transition;
428415
}
429416

430417
%igx-chip__item--primary {
@@ -757,12 +744,15 @@
757744
%igx-chip__select {
758745
display: inline-flex;
759746
align-items: center;
747+
max-width: rem(24px);
760748
opacity: 1;
761749
z-index: 1;
762-
transition: opacity 120ms $out-quad, width 120ms $out-quad;
750+
transition: max-width .12s $in-out-quad, opacity .12s $in-out-quad .06s;
751+
transition-behavior: allow-discrete;
763752

764-
> * {
765-
width: inherit !important;
753+
@starting-style {
754+
max-width: 0;
755+
opacity: 0;
766756
}
767757
}
768758

0 commit comments

Comments
 (0)