OnMouseDown - highlights cells

Tags: #<Tag:0x00007f0b09a46508>

Hi,

We experience an issue. We have a button inside each row to delete the particular row. We trap the onCellMousedown hook and handle the Delete operation. However, all the cells where we move the mouse seems to be highlighted after this. The same issue can be seen in the demo https://stackblitz.com/edit/angular-handsontable-custom-renderer?file=app%2Fapp.component.ts

When you click on any button in the demo and then click OK in the prompt, any cell where you move your mouse will get highlighted…

Hey @prasanth.sivakumar

it looks like the line 17 is an issue here.

What exactly you’ll like to accomplish with this example?

We have a Delete buttoin in each row. When the user click the button, it will prompt a confirmation. The row need to be deleted once the user accept the confirmation. We hook onCellMousedown and the row is getting deleted. All good with that. The issue is that when the user click on Delete, the highlight will get expanded to whatever cell we are moving to… Exactly the same behaviour we can see in the demo, i clicked on the button in the second row and it prompted me. When i move the mouse to any cell after that,you can see the highlight getting expanded to these cells. (see screenshot attached)

Have you tried the afterSelectionEnd hook? It returns coordinates as parameters (start_row, end_column, start_column, end_columns)

If you call instance.getSelected() you’ll get the cell <td> element .

Aleksandra, i dont think it is an issue with selection… Even i tried to select a cell. The cell is getting selected, but the highlight is expanding with mouse move… could you figure out anything from the demo i shared?

I saw a similar issue before but as I remember it was fixed some time ago. I can see that you’re using an older version of Handsontable. Have you tried to load the latest one? It is 6.2.2

Aleksandra, we are using 6.2.2 in our project…

Another observation is that the issue occurs only if we show alert or confirm popup. For example, i fi comment the line 43 in the demo, the highlight issue does not seem to occur.

I will track down the issue (try to find the issue that related to this one) and get back to you.

Hey @prasanth.sivakumar

I’ve just got a demo from our programmer. Please check https://stackblitz.com/edit/angular-prpkr8?file=src/app/app.component.ts and let me know if it meets your project requirements.