BaseEditor.beginEditing() selects the first value, not the current

Tags: #<Tag:0x00007f8b28d0ecc8> #<Tag:0x00007f8b28d0eac0>

When I use BaseEditor.beginEditing to activate a cell editor for a dropdown cell, it will start with the first option selected. But when I manually double click it will have the current value selected (if it’s available in the options). This causes unintended edits when you open the editor and cancels by clicking outside.

Is there a way to get beginEditing to behave the same as when double clicking the cell, to get it to select the current value?

https://jsfiddle.net/hzgn5oLt/

Start edit of any cell.
Set the value to orange or something.
with the same cell selected press the button to edit
now the value in the dropdown should be orange, but is yellow (the first)
click outside to cancel edit
now the cell value is changed to yellow…

Hi @mottosson

This is intended behavior of beginEditing() method, as it doesn’t simulate true key/mouse events. To simulate those events you need to also add enableFullEditMode() method before. Here’s an example: https://jsfiddle.net/aszymanski/tmLp7gj4/

Oh, didn’t know enableFullEditMode was a thing. Thanks a lot! :slight_smile: