@hashicorp/design-system-components 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 2.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1344](https://github.com/hashicorp/design-system/pull/1344) [`6d6cf3ea8`](https://github.com/hashicorp/design-system/commit/6d6cf3ea81bf5bd1f631c99fc53cc88318d7d52f) Thanks [@cbfx](https://github.com/cbfx)! - `SideNav::Portal::Target` - Fixed a possible source of flickering when a panel has already been rendered
|
|
8
|
+
|
|
3
9
|
## 2.3.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -9,12 +9,12 @@ import { tracked } from '@glimmer/tracking';
|
|
|
9
9
|
import { action } from '@ember/object';
|
|
10
10
|
import { DEBUG } from '@glimmer/env';
|
|
11
11
|
import Ember from 'ember';
|
|
12
|
-
import { debounce } from '@ember/runloop';
|
|
13
12
|
|
|
14
13
|
export default class SidenavPortalTarget extends Component {
|
|
15
14
|
@service router;
|
|
16
15
|
|
|
17
16
|
@tracked numSubnavs = 0;
|
|
17
|
+
@tracked lastPanelEl = null;
|
|
18
18
|
|
|
19
19
|
static get prefersReducedMotionOverride() {
|
|
20
20
|
return Ember.testing;
|
|
@@ -38,7 +38,7 @@ export default class SidenavPortalTarget extends Component {
|
|
|
38
38
|
|
|
39
39
|
@action
|
|
40
40
|
didUpdateSubnav(element, [count]) {
|
|
41
|
-
|
|
41
|
+
this.animateSubnav(element, [count]);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
@action
|
|
@@ -135,14 +135,23 @@ export default class SidenavPortalTarget extends Component {
|
|
|
135
135
|
|
|
136
136
|
// fade in next panel
|
|
137
137
|
let nextPanelEl = targetElement.children[activeIndex];
|
|
138
|
+
|
|
139
|
+
// get reference to last child panel
|
|
140
|
+
let lastPanelEl = targetElement.children[targetElement.children.length - 1];
|
|
141
|
+
|
|
138
142
|
if (nextPanelEl) {
|
|
139
143
|
nextPanelEl.ariaHidden = 'false';
|
|
140
144
|
nextPanelEl.style.setProperty('visibility', 'visible');
|
|
141
|
-
// this eliminates a flicker if there's only
|
|
142
|
-
|
|
145
|
+
// this eliminates a flicker if there's only one subnav rendering or if we
|
|
146
|
+
// already just rendered this panel.
|
|
147
|
+
if (activeIndex === 0 || nextPanelEl.isSameNode(this.lastPanelEl)) {
|
|
143
148
|
fadeDelay = 0;
|
|
144
149
|
fadeDuration = 0;
|
|
145
150
|
}
|
|
151
|
+
|
|
152
|
+
// remember the last panel
|
|
153
|
+
this.lastPanelEl = lastPanelEl;
|
|
154
|
+
|
|
146
155
|
nextPanelEl.animate([{ opacity: '0' }, { opacity: '1' }], {
|
|
147
156
|
delay: fadeDelay,
|
|
148
157
|
duration: fadeDuration,
|