@designsystem-se/af-angular 39.2.1-beta.1 → 39.2.1

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.
@@ -8287,8 +8287,25 @@ class ValueAccessor {
8287
8287
  this.onChange(value);
8288
8288
  }
8289
8289
  }
8290
- _handleBlurEvent() {
8291
- this.onTouched();
8290
+ _handleBlurEvent(event) {
8291
+ const host = this.el.nativeElement;
8292
+ const relatedTarget = event?.relatedTarget;
8293
+ if (relatedTarget && host.contains(relatedTarget)) {
8294
+ return;
8295
+ }
8296
+ if (relatedTarget) {
8297
+ this.onTouched();
8298
+ return;
8299
+ }
8300
+ // Programmatic .focus() often has relatedTarget === null. Wait until
8301
+ // nested host→input hops have settled, then treat as blur only if
8302
+ // focus actually left the component.
8303
+ setTimeout(() => {
8304
+ const active = document.activeElement;
8305
+ if (!active || !host.contains(active)) {
8306
+ this.onTouched();
8307
+ }
8308
+ });
8292
8309
  }
8293
8310
  registerOnChange(fn) {
8294
8311
  this.onChange = fn;
@@ -8300,14 +8317,14 @@ class ValueAccessor {
8300
8317
  this.el.nativeElement.disabled = isDisabled;
8301
8318
  }
8302
8319
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ValueAccessor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
8303
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.19", type: ValueAccessor, isStandalone: true, host: { listeners: { "focusout": "_handleBlurEvent()" } }, ngImport: i0 }); }
8320
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.19", type: ValueAccessor, isStandalone: true, host: { listeners: { "focusout": "_handleBlurEvent($event)" } }, ngImport: i0 }); }
8304
8321
  }
8305
8322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ValueAccessor, decorators: [{
8306
8323
  type: Directive,
8307
8324
  args: [{}]
8308
8325
  }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { _handleBlurEvent: [{
8309
8326
  type: HostListener,
8310
- args: ['focusout']
8327
+ args: ['focusout', ['$event']]
8311
8328
  }] } });
8312
8329
 
8313
8330
  class BooleanValueAccessor extends ValueAccessor {