mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-18 02:19:57 +00:00
fixed autofocus in input fields (fixes #374)
This commit is contained in:
parent
38e450f70a
commit
d6fb71dca2
@ -81,5 +81,6 @@ $tabs-height: 36px;
|
|||||||
top: 0;
|
top: 0;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
transition: 0.25s width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
terminus-core/src/directives/autofocus.directive.ts
Normal file
15
terminus-core/src/directives/autofocus.directive.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { Directive, AfterViewInit, ElementRef } from '@angular/core'
|
||||||
|
|
||||||
|
@Directive({
|
||||||
|
selector: '[autofocus]'
|
||||||
|
})
|
||||||
|
export class AutofocusDirective implements AfterViewInit {
|
||||||
|
constructor (private el: ElementRef) { }
|
||||||
|
|
||||||
|
ngAfterViewInit () {
|
||||||
|
this.el.nativeElement.blur()
|
||||||
|
setTimeout(() => {
|
||||||
|
this.el.nativeElement.focus()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -30,6 +30,8 @@ import { ToggleComponent } from './components/toggle.component'
|
|||||||
import { WindowControlsComponent } from './components/windowControls.component'
|
import { WindowControlsComponent } from './components/windowControls.component'
|
||||||
import { RenameTabModalComponent } from './components/renameTabModal.component'
|
import { RenameTabModalComponent } from './components/renameTabModal.component'
|
||||||
|
|
||||||
|
import { AutofocusDirective } from './directives/autofocus.directive'
|
||||||
|
|
||||||
import { HotkeyProvider } from './api/hotkeyProvider'
|
import { HotkeyProvider } from './api/hotkeyProvider'
|
||||||
import { ConfigProvider } from './api/configProvider'
|
import { ConfigProvider } from './api/configProvider'
|
||||||
import { Theme } from './api/theme'
|
import { Theme } from './api/theme'
|
||||||
@ -80,6 +82,7 @@ const PROVIDERS = [
|
|||||||
WindowControlsComponent,
|
WindowControlsComponent,
|
||||||
RenameTabModalComponent,
|
RenameTabModalComponent,
|
||||||
SafeModeModalComponent,
|
SafeModeModalComponent,
|
||||||
|
AutofocusDirective,
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
RenameTabModalComponent,
|
RenameTabModalComponent,
|
||||||
@ -88,6 +91,7 @@ const PROVIDERS = [
|
|||||||
exports: [
|
exports: [
|
||||||
CheckboxComponent,
|
CheckboxComponent,
|
||||||
ToggleComponent,
|
ToggleComponent,
|
||||||
|
AutofocusDirective,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export default class AppModule {
|
export default class AppModule {
|
||||||
|
@ -4,6 +4,7 @@ import { FormsModule } from '@angular/forms'
|
|||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { ToastrModule } from 'ngx-toastr'
|
import { ToastrModule } from 'ngx-toastr'
|
||||||
import { ToolbarButtonProvider, ConfigProvider } from 'terminus-core'
|
import { ToolbarButtonProvider, ConfigProvider } from 'terminus-core'
|
||||||
|
import TerminusCoreModule from 'terminus-core'
|
||||||
import { SettingsTabProvider } from 'terminus-settings'
|
import { SettingsTabProvider } from 'terminus-settings'
|
||||||
|
|
||||||
import { EditConnectionModalComponent } from './components/editConnectionModal.component'
|
import { EditConnectionModalComponent } from './components/editConnectionModal.component'
|
||||||
@ -23,6 +24,7 @@ import { SSHSettingsTabProvider } from './settings'
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ToastrModule,
|
ToastrModule,
|
||||||
|
TerminusCoreModule,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
PasswordStorageService,
|
PasswordStorageService,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user