PeerTube/client
lutangar 2873a53efd Set scroll position at top of the textarea when opening the subtitle editor.
## Description

This set the position of the scrollbar at the top of the textarea when opening the __subtitle editor__.
Previously the textarea scroll position was at the bottom of the textarea which doesn't make much sense when you want to edit a subtitle : you most likely want to edit the beginning of the subtitle first.

This also set the caret position on the first character.

## Design decision

I had to use a *component approach* instead of an `<ng-template>` for the edition modal because the `@viewChild` directive doesn't work for elements __inside__ an `<ng-template>`.
I needed the `viewChild` directive to get an `ElementRef` of the `textarea`.

> See the following issue and its workaround :
> - https://github.com/valor-software/ngx-bootstrap/issues/3825
> - https://stackblitz.com/edit/angular-t5dfp7
> - https://medium.com/@izzatnadiri/how-to-pass-data-to-and-receive-from-ng-bootstrap-modals-916f2ad5d66e

## Related issues
Closes [peertube-plugin-transcription/#39](https://gitlab.com/apps_education/peertube/plugin-transcription/-/issues/39)
2022-09-08 08:41:36 +02:00
..
e2e Fix z-index with custom homepage 2022-07-18 15:01:47 +02:00
src Set scroll position at top of the textarea when opening the subtitle editor. 2022-09-08 08:41:36 +02:00
webpack Fix stucked HLS player 2022-07-21 12:08:47 +02:00
.browserslistrc
.eslintrc.json Fix lint 2022-07-13 12:14:26 +02:00
.gitignore Update angular 2021-11-10 16:33:55 +01:00
.stylelintrc.json
.xliffmerge.json Update xliffmerge 2021-11-15 15:56:58 +01:00
angular.json Disallow sending analytics data to Angular team 2022-08-04 09:49:37 +02:00
package.json Upgrade client dependencies 2022-07-27 15:24:51 +02:00
proxy.config.json
tsconfig.eslint.json Speed up client lint 2021-08-18 10:44:16 +02:00
tsconfig.json More precise date for jobs 2022-08-10 10:26:20 +02:00
tsconfig.types.json Move types package in packages/ 2021-12-28 10:18:15 +01:00
yarn.lock Upgrade client dependencies 2022-07-27 15:24:51 +02:00