@frame-kit/ui-ng 0.2.19 → 0.2.20
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.
|
@@ -2366,6 +2366,7 @@ class SwitchComponent {
|
|
|
2366
2366
|
self: true,
|
|
2367
2367
|
});
|
|
2368
2368
|
inputRef = viewChild('inputEl', ...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
2369
|
+
host = inject(ElementRef);
|
|
2369
2370
|
// ===== INPUTS =====
|
|
2370
2371
|
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
2371
2372
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
@@ -2412,7 +2413,16 @@ class SwitchComponent {
|
|
|
2412
2413
|
setDescribedByIds(ids) {
|
|
2413
2414
|
this.describedByIdsSignal.set(ids);
|
|
2414
2415
|
}
|
|
2415
|
-
onContainerClick(
|
|
2416
|
+
onContainerClick(event) {
|
|
2417
|
+
// A click on the switch itself has already toggled it through the
|
|
2418
|
+
// switch's own <label>. The form field forwards every click in its
|
|
2419
|
+
// control area here, so acting on that one too would toggle it straight
|
|
2420
|
+
// back. Only a click elsewhere in the control area (text beside the
|
|
2421
|
+
// switch) is the form field's to forward.
|
|
2422
|
+
if (event.target instanceof Node &&
|
|
2423
|
+
this.host.nativeElement.contains(event.target)) {
|
|
2424
|
+
return;
|
|
2425
|
+
}
|
|
2416
2426
|
const input = this.inputRef()?.nativeElement;
|
|
2417
2427
|
if (input && !this.isDisabledSignal()) {
|
|
2418
2428
|
input.focus();
|