I have a JQuery-based single-page web application with a rich Knockout-based grid.
When I double-click on a row in the Knockout grid, I load a virtual page of data with the details for the selected item, and when I'm done editing it (or if I cancel), I'm returned to the grid. All of this happens on a single page.
If I double-click on a non-text area in the grid or if I set focus to an input field in the form, everything works great when the grid is redisplayed. But if I double-click on some text in a row (like the row item's "Name") and then immediately click "Cancel" to return to the grid, then all of grid's HTML is selected when I redisplay it. It's as if I had clicked and dragged through the grid to select a giant region of text.
I've been trying to programmatically deselect this selected text but to no avail. I've tried various combinations of:
$(document).focus();
$("#idBody").focus();
$("#idBody").trigger("click");
If I click on a region outside the grid, I get the behavior I want. What are my options?