From 26e2c602654f9b35273f65067ffb43bd29673054 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 4 Jul 2021 13:47:38 +0200 Subject: [PATCH] option to always ask for baud rate --- .../src/components/serialProfileSettings.component.pug | 7 +++++-- .../src/components/serialProfileSettings.component.ts | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tabby-serial/src/components/serialProfileSettings.component.pug b/tabby-serial/src/components/serialProfileSettings.component.pug index e29ae568..41b46f56 100644 --- a/tabby-serial/src/components/serialProfileSettings.component.pug +++ b/tabby-serial/src/components/serialProfileSettings.component.pug @@ -8,9 +8,10 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') label Device input.form-control( type='text', + alwaysShowTypeahead, [(ngModel)]='profile.options.port', [ngbTypeahead]='portsAutocomplete', - [resultFormatter]='portsFormatter', + [resultFormatter]='portsFormatter' ) .col-6 @@ -18,8 +19,10 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') label Baud Rate input.form-control( type='number', + alwaysShowTypeahead, + placeholder='Ask every time', [(ngModel)]='profile.options.baudrate', - [ngbTypeahead]='baudratesAutocomplete', + [ngbTypeahead]='baudratesAutocomplete' ) .form-line diff --git a/tabby-serial/src/components/serialProfileSettings.component.ts b/tabby-serial/src/components/serialProfileSettings.component.ts index 6e17be49..cae6e8d2 100644 --- a/tabby-serial/src/components/serialProfileSettings.component.ts +++ b/tabby-serial/src/components/serialProfileSettings.component.ts @@ -49,7 +49,10 @@ export class SerialProfileSettingsComponent implements ProfileSettingsComponent baudratesAutocomplete = text$ => text$.pipe( debounceTime(200), distinctUntilChanged(), - map((q: string) => BAUD_RATES.filter(x => !q || x.toString().startsWith(q))) + map((q: string) => [ + null, + ...BAUD_RATES.filter(x => !q || x.toString().startsWith(q)), + ]) ) portsFormatter = port => {