mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-01 20:29:00 +00:00
fix: сохранить точную активацию маркера (#564)
Issue: #564 User-Visible: yes
This commit is contained in:
@@ -265,8 +265,10 @@ export class DeviceHitController {
|
||||
public click<T extends RenderedDeviceHitItem>(
|
||||
root: ParentNode, devices: readonly T[], space: string | null, ev: Event, fallback: T,
|
||||
): T {
|
||||
if (ev instanceof KeyboardEvent) return fallback;
|
||||
const point = ev as PointerEvent;
|
||||
// Keyboard/programmatic activation is already bound to an exact marker.
|
||||
// Only a real pointer click carries coordinates that need arbitration.
|
||||
if (!(ev instanceof PointerEvent)) return fallback;
|
||||
const point = ev;
|
||||
const id = Number.isFinite(point.pointerId) ? this.pointers.consumeClick(point.pointerId) : null;
|
||||
return this.byId(devices, space, id)
|
||||
|| this.at(root, devices, space, point.clientX, point.clientY)
|
||||
|
||||
@@ -5742,7 +5742,7 @@ export class HouseplanCard extends LitElement {
|
||||
const presentation = this._devicePresentation(d, showLqi);
|
||||
const disabledReason = presentation.disabledReason;
|
||||
const ghostLabel = presentation.haDisabled
|
||||
? this._t((`marker.ha_disabled_${disabledReason}`) as any)
|
||||
? this._t((`marker.ha_disabled_${disabledReason}`) as I18nKey)
|
||||
: d.userHidden ? this._t('marker.hidden_ghost') : d.name;
|
||||
const metrics = [
|
||||
d.model,
|
||||
|
||||
Reference in New Issue
Block a user