Skip to content

Commit 2182d6a

Browse files
rundmtryanjduffy
authored andcommitted
ENYO-4870: Fix Panel failure to focus before previous panel unmounts (#1268)
* moved call entering job after other component unmounts Enact-DCO-1.0-Signed-off-by: Derek Tor (derek.tor@lge.com) * cleanup and added null check * null entering component on unmount * Added check to wait for both entering and leaving to complete * using spotlight blur * updated changelog Reviewed-by: Stephen Choi (stephen.choi@lge.com) Integrated-By: Ryan Duffy (ryan.duffy@lge.com)
1 parent 71f519c commit 2182d6a

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

packages/moonstone/Panels/Viewport.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ const ViewportBase = class extends React.Component {
9191
return true;
9292
}
9393

94+
mayBlurSpotlight = () => {
95+
const current = Spotlight.getCurrent();
96+
if (current && this.node.contains(current)) {
97+
current.blur();
98+
}
99+
100+
return true;
101+
}
102+
94103
handle = handle.bind(this)
95104

96105
handleTransition = this.handle(
@@ -102,6 +111,7 @@ const ViewportBase = class extends React.Component {
102111
handleWillTransition = this.handle(
103112
forward('onWillTransition'),
104113
this.addTransitioningClass,
114+
this.mayBlurSpotlight,
105115
Spotlight.pause
106116
)
107117

@@ -133,7 +143,6 @@ const ViewportBase = class extends React.Component {
133143
className={className}
134144
component="main"
135145
duration={250}
136-
enteringDelay={100} // TODO: Can we remove this?
137146
enteringProp={enteringProp}
138147
index={index}
139148
noAnimation={noAnimation}

packages/ui/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ The following is a curated list of changes in the Enact ui module, newest change
99
### Changed
1010

1111
### Fixed
12+
- `ui/Viewport` to blur Spotlight `onWillTransition`
13+
- `ui/View` use `idleUntil` to prevent wheel blocking error
1214

1315
- `ui/Remeasurable` to update on every trigger change
1416
- `ui/ViewManager` to suppress `enteringProp` for views that are rendered at mount

packages/ui/ViewManager/View.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ class View extends React.Component {
178178
}
179179

180180
componentDidEnter () {
181-
const {enteringDelay, enteringProp} = this.props;
181+
const {enteringDelay} = this.props;
182182

183-
if (enteringProp) {
184-
// FIXME: `startRafAfter` is a temporary solution using rAF. We need a better way to handle
185-
// transition cycle and component life cycle to be in sync. See ENYO-4835.
186-
this.enteringJob.startRafAfter(enteringDelay);
183+
if (enteringDelay) {
184+
this.enteringJob.startAfter(enteringDelay);
185+
} else {
186+
this.enteringJob.idleUntil(100);
187187
}
188188
}
189189

0 commit comments

Comments
 (0)