Commit 02edcc25 authored by liujiaxin's avatar liujiaxin

fix: autofocus

parent 04e6ad70
......@@ -102,7 +102,7 @@
</nz-spin>
</div>
<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="ctrl-bar">
</div>
......
......@@ -215,8 +215,8 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
this.adContext.decodeAudioData(ab).then(adb => {
this.draw(adb);
this.isLoadingAudioBuffer = false;
(document.activeElement as HTMLButtonElement).blur();
this.canvasElRef.nativeElement.focus();
// (document.activeElement as HTMLButtonElement).blur();
// this.canvasElRef.nativeElement.focus();
});
}
......@@ -271,12 +271,11 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
e.stopPropagation();
if (e.code === 'ArrowUp') {
this.togglePlayAudio();
this.canvasElRef.nativeElement.focus();
// this.canvasElRef.nativeElement.focus();
}
if (e.code === 'ArrowDown') {
this.setTimestampPoint();
this.canvasElRef.nativeElement.focus();
// this.canvasElRef.nativeElement.focus();
// set time point
}
if (e.code === 'ArrowLeft') {
......@@ -285,7 +284,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
} else {
this.audioObj.currentTime -= 1;
}
this.canvasElRef.nativeElement.focus();
// this.canvasElRef.nativeElement.focus();
}
if (e.code === 'ArrowRight') {
......@@ -294,7 +293,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
} else {
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