close panel and unfocus on esc, fix #429

This commit is contained in:
Nicolas Constant 2023-08-06 17:15:00 -04:00
parent 4a34063dc8
commit 62d4140d63
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,8 @@
<form class="status-editor" (ngSubmit)="onSubmit()">
<input [(ngModel)]="title" type="text" class="form-control form-control-sm status-editor__title" name="title"
autocomplete="off" placeholder="Title, Content Warning (optional)" title="title, content warning (optional)" dir="auto" />
<input #mytitle [(ngModel)]="title" type="text" class="form-control form-control-sm status-editor__title"
name="title" autocomplete="off" placeholder="Title, Content Warning (optional)"
title="title, content warning (optional)" dir="auto"
(keydown.escape)="mytitle.blur()" />
<a class="status-editor__emoji" title="Insert Emoji"
#emojiButton href (click)="openEmojiPicker($event)">
@ -11,10 +13,11 @@
{{ selectedLanguage.iso639 }}
</a>
<textarea #reply [(ngModel)]="status" name="status" class="form-control form-control-sm status-editor__content" (paste)="onPaste($event)"
<textarea #reply [(ngModel)]="status" name="status" class="form-control form-control-sm status-editor__content" (paste)="onPaste($event)"
rows="5" required title="content" placeholder="What's on your mind?"
(keydown.control.enter)="onCtrlEnter()"
(keydown.meta.enter)="onCtrlEnter()"
(keydown.escape)="reply.blur()"
(keydown)="handleKeyDown($event)" (blur)="statusTextEditorLostFocus()" dir="auto">
</textarea>

View File

@ -5,7 +5,7 @@
<form class="form-section" (ngSubmit)="onSubmit()">
<input #search type="text" class="form-control form-control-sm form-with-button" [(ngModel)]="searchHandle"
name="searchHandle" placeholder="Search" autocomplete="off" />
name="searchHandle" placeholder="Search" autocomplete="off" (keydown.escape)="search.blur()"/>
<button class="form-button" type="submit" title="search">GO</button>
</form>
</div>