diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/shared/shared-forms/markdown-textarea.component.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.ts b/client/src/app/shared/shared-forms/markdown-textarea.component.ts index d47f22d1d..b626071eb 100644 --- a/client/src/app/shared/shared-forms/markdown-textarea.component.ts +++ b/client/src/app/shared/shared-forms/markdown-textarea.component.ts | |||
@@ -4,7 +4,7 @@ import { Subject } from 'rxjs' | |||
4 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | 4 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' |
5 | import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core' | 5 | import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core' |
6 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 6 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
7 | import { MarkdownService } from '@app/core' | 7 | import { MarkdownService, ScreenService } from '@app/core' |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-markdown-textarea', | 10 | selector: 'my-markdown-textarea', |
@@ -40,6 +40,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
40 | 40 | ||
41 | constructor ( | 41 | constructor ( |
42 | private viewportScroller: ViewportScroller, | 42 | private viewportScroller: ViewportScroller, |
43 | private screenService: ScreenService, | ||
43 | private markdownService: MarkdownService | 44 | private markdownService: MarkdownService |
44 | ) { } | 45 | ) { } |
45 | 46 | ||
@@ -80,7 +81,10 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
80 | this.isMaximized = !this.isMaximized | 81 | this.isMaximized = !this.isMaximized |
81 | 82 | ||
82 | // Make sure textarea have the focus | 83 | // Make sure textarea have the focus |
83 | this.textareaElement.nativeElement.focus() | 84 | // Except on touchscreens devices, the virtual keyboard may move up and hide the textarea in maximized mode |
85 | if (!this.screenService.isInTouchScreen()) { | ||
86 | this.textareaElement.nativeElement.focus() | ||
87 | } | ||
84 | 88 | ||
85 | // Make sure the window has no scrollbars | 89 | // Make sure the window has no scrollbars |
86 | if (!this.isMaximized) { | 90 | if (!this.isMaximized) { |