@lightningjs/blits 1.35.4 → 1.35.5
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 +8 -1
- package/package.json +1 -1
- package/src/components/RouterView.js +4 -1
- package/src/router/router.js +3 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import Component from '../component.js'
|
|
19
19
|
import Router from '../router/router.js'
|
|
20
20
|
import symbols from '../lib/symbols.js'
|
|
21
|
+
import Focus from '../focus.js'
|
|
21
22
|
|
|
22
23
|
let hashchangeHandler = null
|
|
23
24
|
|
|
@@ -93,7 +94,9 @@ export default () =>
|
|
|
93
94
|
window.removeEventListener('hashchange', hashchangeHandler, false)
|
|
94
95
|
},
|
|
95
96
|
focus() {
|
|
96
|
-
this.activeView &&
|
|
97
|
+
if (this.activeView && Focus.get() === this) {
|
|
98
|
+
this.activeView.$focus()
|
|
99
|
+
}
|
|
97
100
|
},
|
|
98
101
|
},
|
|
99
102
|
input: {
|
package/src/router/router.js
CHANGED
|
@@ -337,6 +337,9 @@ export const navigate = async function () {
|
|
|
337
337
|
// keep reference to the previous focus for storing in cache
|
|
338
338
|
previousFocus = Focus.get()
|
|
339
339
|
|
|
340
|
+
const children = this[symbols.children]
|
|
341
|
+
this.activeView = children[children.length - 1]
|
|
342
|
+
|
|
340
343
|
// set focus to the view that we're routing to
|
|
341
344
|
focus ? focus.$focus() : /** @type {BlitsComponent} */ (view).$focus()
|
|
342
345
|
|
|
@@ -380,8 +383,6 @@ export const navigate = async function () {
|
|
|
380
383
|
await setOrAnimate(holder, route.transition.in, shouldAnimate)
|
|
381
384
|
}
|
|
382
385
|
}
|
|
383
|
-
const children = this[symbols.children]
|
|
384
|
-
this.activeView = children[children.length - 1]
|
|
385
386
|
} else {
|
|
386
387
|
Log.error(`Route ${hash} not found`)
|
|
387
388
|
const routerHooks = this.parent[symbols.routerHooks]
|