Small (un)focusing problem in Juce Demo

I am using a structure similar to the one in the Widget Tables demo, except that some columns are editable (TextEditor). I noticed that, when a cell was selected and I was scrolling the table down, cells after a page length were showing the editing caret and were basically "selected" as well. The same appears in the Juce Demo with ComboBoxes, but is less visible because only the cell border is slightly changed.

I used this code in the setRowAndColumn method to fix the problem in the Demo but was wondering if that was the correct way to do it:

    if (comboBox.hasKeyboardFocus(true))
        comboBox.unfocusAllComponents();    // In combox component's setRowAndColumn method

and in my code (TextEditor cells)

    if (textCell.hasKeyboardFocus(true))
        textCell.unfocusAllComponents();    // In TextEditor component's setRowAndColumn method

Any hint ?