Skip to content
Snippets Groups Projects
Commit 1a1ed4f5 authored by jojohoch's avatar jojohoch
Browse files

[player] Allow moving the keyboard only at its header

parent 3b09148e
No related branches found
No related tags found
No related merge requests found
......@@ -31,5 +31,6 @@ export class FrenchKeyboardComponent implements OnInit {
this.rows = this.upperCharacterRows;
}
event.preventDefault();
event.stopPropagation();
}
}
<button mat-mini-fab class="key"
(mousedown)="onMouseDown($event)">{{key}}
<button mat-mini-fab
class="key"
(mousedown)="onMouseDown($event)">{{key}}
</button>
......@@ -14,5 +14,6 @@ export class KeyComponent {
onMouseDown(event: MouseEvent): void {
this.keyboardService.enterKey(this.key);
event.preventDefault();
event.stopPropagation();
}
}
<div class="keyboard-container" (mousedown)="onMouseDown($event)">
<div class="keyboard-container"
(mousedown)="onMouseDown($event, false)">
<div class="keyboard-header"></div>
<div class="keyboard-inner-container">
<div class="keyboard-inner-container"
(mousedown)="onMouseDown($event, true)">
<app-french-keyboard *ngIf="preset === 'french'">
</app-french-keyboard>
</div>
......
......@@ -8,7 +8,10 @@ import { Component, Input } from '@angular/core';
export class KeyboardComponent {
@Input() preset!: 'french' | 'numbers' | 'numbersAndOperators' | 'none';
onMouseDown = (event: MouseEvent): void => {
onMouseDown = (event: MouseEvent, stopPropagation: boolean): void => {
event.preventDefault();
if (stopPropagation) {
event.stopPropagation();
}
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment