Commit 02edcc25 authored by liujiaxin's avatar liujiaxin

fix: autofocus

parent 04e6ad70
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</nz-spin> </nz-spin>
</div> </div>
<div class="wave-player" [ngStyle]="{visibility: LRCData.audio_url ? 'visible' : 'hidden'}" > <div class="wave-player" [ngStyle]="{visibility: LRCData.audio_url ? 'visible' : 'hidden'}" >
<canvas #waveEl autofocus></canvas> <canvas #waveEl></canvas>
<div class="time-line" #timeLineEl> <div class="time-line" #timeLineEl>
<div class="ctrl-bar"> <div class="ctrl-bar">
</div> </div>
......
...@@ -215,8 +215,8 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi ...@@ -215,8 +215,8 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
this.adContext.decodeAudioData(ab).then(adb => { this.adContext.decodeAudioData(ab).then(adb => {
this.draw(adb); this.draw(adb);
this.isLoadingAudioBuffer = false; this.isLoadingAudioBuffer = false;
(document.activeElement as HTMLButtonElement).blur(); // (document.activeElement as HTMLButtonElement).blur();
this.canvasElRef.nativeElement.focus(); // this.canvasElRef.nativeElement.focus();
}); });
} }
...@@ -271,12 +271,11 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi ...@@ -271,12 +271,11 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
e.stopPropagation(); e.stopPropagation();
if (e.code === 'ArrowUp') { if (e.code === 'ArrowUp') {
this.togglePlayAudio(); this.togglePlayAudio();
this.canvasElRef.nativeElement.focus(); // this.canvasElRef.nativeElement.focus();
} }
if (e.code === 'ArrowDown') { if (e.code === 'ArrowDown') {
this.setTimestampPoint(); this.setTimestampPoint();
this.canvasElRef.nativeElement.focus(); // this.canvasElRef.nativeElement.focus();
// set time point // set time point
} }
if (e.code === 'ArrowLeft') { if (e.code === 'ArrowLeft') {
...@@ -285,7 +284,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi ...@@ -285,7 +284,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
} else { } else {
this.audioObj.currentTime -= 1; this.audioObj.currentTime -= 1;
} }
this.canvasElRef.nativeElement.focus(); // this.canvasElRef.nativeElement.focus();
} }
if (e.code === 'ArrowRight') { if (e.code === 'ArrowRight') {
...@@ -294,7 +293,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi ...@@ -294,7 +293,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
} else { } else {
this.audioObj.currentTime += 1; this.audioObj.currentTime += 1;
} }
this.canvasElRef.nativeElement.focus(); // this.canvasElRef.nativeElement.focus();
} }
}); });
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment