Skip to content

Commit

Permalink
fix:the edit report-name input should remain in focus (#3252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sishhhh authored Nov 5, 2024
1 parent 3123621 commit fe8622e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</div>
<input
matInput
#reportNameInput
[(ngModel)]="reportName"
[maxLength]="250"
class="edit-report-name--input-container__input smartlook-show"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core';
import { PopoverController } from '@ionic/angular';

@Component({
Expand All @@ -9,15 +9,21 @@ import { PopoverController } from '@ionic/angular';
export class EditReportNamePopoverComponent implements OnInit {
@Input() reportName: string;

@ViewChild('reportNameInput') reportNameInput: ElementRef<HTMLInputElement>;

constructor(private popoverController: PopoverController) {}

ngOnInit(): void {}
ngOnInit(): void {
setTimeout(() => {
this.reportNameInput.nativeElement.focus();
}, 100);
}

closePopover() {
closePopover(): void {
this.popoverController.dismiss();
}

saveReportName() {
saveReportName(): void {
this.popoverController.dismiss({ reportName: this.reportName });
}
}

0 comments on commit fe8622e

Please sign in to comment.