Select text in dropdown editor upon opening dropdown

I want to automatically highlight the value in a dropdown cell

However, There is currently a issue with my implementation where if the dropdown option is rather long and the selected value is not on the visible area of the dropdown. It will highlight the textarea and then quickly lost hight light.

for example double click on black / blue will automatically hight light the value, but if i double click on “7”, then it will lost the hightlight.

Do you have any idea why this is happening?

Hi @haoliu

Can you please describe more your expected result and how to exactly reproduce the issue? When I’m performing the double click on the cells you mentioned the highlight works correctly in each case.

I have a loom video illustrating the issue here handsontable - StackBlitz - 15 July 2025 | Loom

@haoliu

Thank you for the recording. The reason for this behavior is our complex focus management that has to be up to WCAG standards so specific parts of the table are accessible for the screen readers.

In this case the highlight is lost either on a scroll action (which switches the focus) or if the dropdown is opened in the last row of the table (then focus is switched outside the table). It might be hard to alter this behavior but you can start with checking our focus manager: Core API reference - JavaScript Data Grid | Handsontable

I didn’t quite get how the focus manager will help alter this behavior. I check the documentation and was not able to understand what is the different between

    • CELL - The browser’s focus stays on the lastly selected cell element.
    • MIXED - The browser’s focus switches from the lastly selected cell element to the currently active editor’s TEXTAREA element after a delay defined in the manager.

those two different focus mode

Is there any example of these or how can focus manager help in this case?

@haoliu

I’m sorry, I thought it’s possible to modify it, but the methods I had in mind are the part of the private API so it will not be possible to change this behavior from this level.

Are you talking about this line where it might blur and refocus again?

I went in the chrome developer debugger and i don’t this this line being trigger.
In fact, i attach a blur event listener to the text area and the lost of highlight isn’t even trigger by a blur event.

Wondering if you have any insight if there is anywhere else that might trigger it?