mentions ui fix

This commit is contained in:
CITE\spapacharalampous 2024-07-16 12:48:46 +03:00
parent 2283f95a5f
commit 210e3bb552
2 changed files with 16 additions and 5 deletions

View File

@ -6,6 +6,7 @@ import { AnnotationDialogComponent } from './annotation-dialog.component';
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
import { TextAreaWithMentionsComponent } from '../components/text-area-with-mentions.component'; import { TextAreaWithMentionsComponent } from '../components/text-area-with-mentions.component';
import { NgxMentionsModule } from 'ngx-mentions'; import { NgxMentionsModule } from 'ngx-mentions';
import { OverlayModule } from '@angular/cdk/overlay';
@NgModule({ @NgModule({
imports: [ imports: [
@ -14,6 +15,7 @@ import { NgxMentionsModule } from 'ngx-mentions';
FormattingModule, FormattingModule,
AutoCompleteModule, AutoCompleteModule,
NgxMentionsModule, NgxMentionsModule,
OverlayModule,
], ],
declarations: [ declarations: [
AnnotationDialogComponent, AnnotationDialogComponent,

View File

@ -26,10 +26,19 @@
</mat-form-field> </mat-form-field>
<ng-template #menuTemplate <ng-template #menuTemplate
let-selectChoice="selectChoice"> let-selectChoice="selectChoice"
<ngx-text-input-autocomplete-menu *ngIf="choices" [choices]="choices" >
[getDisplayLabel]="getDisplayLabel" <div cdkOverlayOrigin #trigger="cdkOverlayOrigin">
(selectChoice)="selectChoice($event)"> <ng-template
</ngx-text-input-autocomplete-menu> cdkConnectedOverlay
[cdkConnectedOverlayOrigin]="trigger"
cdkConnectedOverlayOpen="true"
>
<ngx-text-input-autocomplete-menu *ngIf="choices" [choices]="choices"
[getDisplayLabel]="getDisplayLabel"
(selectChoice)="selectChoice($event)">
</ngx-text-input-autocomplete-menu>
</ng-template>
</div>
</ng-template> </ng-template>
</div> </div>