77 */
88
99import { DOCUMENT } from '@angular/common' ;
10- import { Directive , ElementRef , Input , inject , output } from '@angular/core' ;
10+ import { Directive , ElementRef , inject , input , output } from '@angular/core' ;
1111
1212@Directive ( {
1313 selector : '[docsClickOutside]' ,
@@ -16,8 +16,7 @@ import {Directive, ElementRef, Input, inject, output} from '@angular/core';
1616 } ,
1717} )
1818export class ClickOutside {
19- // TODO: Understand why replacing this @Input with a signal input breaks the tests
20- @Input ( 'docsClickOutsideIgnore' ) public ignoredElementsIds : string [ ] = [ ] ;
19+ readonly ignoredElementsIds = input < string [ ] > ( [ ] , { alias : 'docsClickOutsideIgnore' } ) ;
2120 public readonly clickOutside = output < void > ( { alias : 'docsClickOutside' } ) ;
2221
2322 private readonly document = inject ( DOCUMENT ) ;
@@ -33,11 +32,11 @@ export class ClickOutside {
3332 }
3433
3534 private wasClickedOnIgnoredElement ( event : MouseEvent ) : boolean {
36- if ( this . ignoredElementsIds . length === 0 ) {
35+ if ( this . ignoredElementsIds ( ) . length === 0 ) {
3736 return false ;
3837 }
3938
40- return this . ignoredElementsIds . some ( ( elementId ) => {
39+ return this . ignoredElementsIds ( ) . some ( ( elementId ) => {
4140 const element = this . document . getElementById ( elementId ) ;
4241 const target = event . target as Node ;
4342 const contains = element ?. contains ( target ) ;
0 commit comments