I want to highlight table cells on mousedown/mouseover behaviour. So whenever I have the mouse pressed and hover over a cell, it shall be highlighted.
In this simple example, there is a small issue: on every second click the mouse gets stuck with the disable-symbol (see screenshot), and the mousedown will not fire until I perform another click.
HTML:
<table>
<tr *ngFor="let rows of groups">
<td *ngFor="let cell of rows.row"
(mousedown)="down(cell)"
(mouseover)="over(cell)"
(mouseup)="up()"
[class.active]="cell.isChecked"
></td>
</tr>
</table>
TS:
active: boolean = false
down(b) {
this.active = true
if (this.active)
b.isChecked = !b.isChecked
}
over(b) {
if (this.active)
b.isChecked = !b.isChecked
}
up() {
this.active = false
}
Is it an event issue of the mouse, browser related or code related?
Thanks in advance.
