@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 CHANGED
@@ -1,6 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## v1.35.3
3
+ ## v1.35.5
4
+
5
+ _06 Aug 2025_
6
+
7
+ - Fixed timing routerview causing focus to be passed to previous page
8
+
9
+
10
+ ## v1.35.4
4
11
 
5
12
  _03 Aug 2025_
6
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.35.4",
3
+ "version": "1.35.5",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -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 && this.activeView.$focus()
97
+ if (this.activeView && Focus.get() === this) {
98
+ this.activeView.$focus()
99
+ }
97
100
  },
98
101
  },
99
102
  input: {
@@ -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]