mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix LaunchBar focus (fix #4808)
This commit is contained in:
parent
4c887a5fae
commit
43a7bf6f87
@ -16,8 +16,11 @@ export class FocusTarget extends EventTarget {
|
|||||||
return this.itemIndex
|
return this.itemIndex
|
||||||
}
|
}
|
||||||
private set index(value: number) {
|
private set index(value: number) {
|
||||||
this.itemIndex = lodash.clamp(value, -1, this.itemLength - 1)
|
const newIndex = lodash.clamp(value, -1, this.itemLength - 1)
|
||||||
this.dispatchEvent(new CustomEvent('index-change', { detail: this }))
|
if (this.itemIndex !== newIndex) {
|
||||||
|
this.itemIndex = newIndex
|
||||||
|
this.dispatchEvent(new CustomEvent('index-change', { detail: this }))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
get hasFocus() {
|
get hasFocus() {
|
||||||
return this.itemIndex > -1
|
return this.itemIndex > -1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user