mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
fix: keep disposed Radio disclosures inert
This commit is contained in:
1 parent
641a2c67e2
commit
53c510fe9f
3 files changed
+5
-1
No files matched your search
@@ -10,6 +10,7 @@ export function bindRadioControls() {
|
|||||||
if (!this._radioPanel) return;
|
if (!this._radioPanel) return;
|
||||||
const tunerListenerOptions = {};
|
const tunerListenerOptions = {};
|
||||||
const setRadioDisclosure = (expanded, { returnFocus = false } = {}) => {
|
const setRadioDisclosure = (expanded, { returnFocus = false } = {}) => {
|
||||||
|
if (this.destroyed) return;
|
||||||
const open = Boolean(expanded);
|
const open = Boolean(expanded);
|
||||||
this._contextRadioDock?.classList.toggle('disclosure-open', open);
|
this._contextRadioDock?.classList.toggle('disclosure-open', open);
|
||||||
if (this._contextRadioMini) this._contextRadioMini.hidden = !open;
|
if (this._contextRadioMini) this._contextRadioMini.hidden = !open;
|
||||||
@@ -23,6 +24,7 @@ export function bindRadioControls() {
|
|||||||
expanded,
|
expanded,
|
||||||
{ returnFocus = false } = {},
|
{ returnFocus = false } = {},
|
||||||
) => {
|
) => {
|
||||||
|
if (this.destroyed) return;
|
||||||
const displayOpen = kind === 'display' && Boolean(expanded);
|
const displayOpen = kind === 'display' && Boolean(expanded);
|
||||||
const radioOpen = kind === 'radio' && Boolean(expanded);
|
const radioOpen = kind === 'radio' && Boolean(expanded);
|
||||||
if (displayOpen || radioOpen) this.actions.setSignalCollapsed(true);
|
if (displayOpen || radioOpen) this.actions.setSignalCollapsed(true);
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export class RadioControls {
|
|||||||
|
|
||||||
/** Keep the Context header Radio shortcut truthful for its current route. */
|
/** Keep the Context header Radio shortcut truthful for its current route. */
|
||||||
_syncContextRadioLauncherState() {
|
_syncContextRadioLauncherState() {
|
||||||
if (!this._contextRadioToggleBtn) return;
|
if (this.destroyed || !this._contextRadioToggleBtn) return;
|
||||||
const contextPanel = document.getElementById('global-context-panel');
|
const contextPanel = document.getElementById('global-context-panel');
|
||||||
const contextExpanded = Boolean(
|
const contextExpanded = Boolean(
|
||||||
contextPanel && !contextPanel.classList.contains('collapsed'),
|
contextPanel && !contextPanel.classList.contains('collapsed'),
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ test('Radio listeners and subscriptions are revoked once before tuning teardown'
|
|||||||
f.controls.destroy();
|
f.controls.destroy();
|
||||||
f.controls.destroy();
|
f.controls.destroy();
|
||||||
const snapshot = structuredClone(f.calls);
|
const snapshot = structuredClone(f.calls);
|
||||||
|
f.controls._setRadioDisclosure(true);
|
||||||
|
f.controls._setCockpitDisclosure('display', true);
|
||||||
f.next.dispatchEvent(new Event('click'));
|
f.next.dispatchEvent(new Event('click'));
|
||||||
f.document.dispatchEvent(new Event('gev:radio-selected'));
|
f.document.dispatchEvent(new Event('gev:radio-selected'));
|
||||||
f.subscribers[0]({ enabled: true });
|
f.subscribers[0]({ enabled: true });
|
||||||
|
|||||||
Reference in new issue
Block a user