Editor keeps previous value if I directly type into the cell without double clicking

Tags: #<Tag:0x00007f51b8fd8d40> #<Tag:0x00007f51b8fd8c00>

I use “handsontable”: “14.6.1”

I have an editor that is inherited from BaseEditor and I have such a case when you click on the cell (with a single click) and enter the value “1” then click on the cell somewhere below in the same column with the same editor and start typing value “2” it will have previously entered value plus current “12”.

When I debug the BaseEditor I see that there is an “if” condition (in the “beginEditing” method) for the “this.isInFullEditMode()” that makes setValue to the editor be skipped.

If I click on the cell twice then it runs the “if” condition this.isInFullEditMode() with true value and sets an empty string to the editor.

Should I somehow handle clearing the editor by myself?

I also debug TextEditor, and I see that the TEXAREA is cleared in the “prepare” and “beginEditing” methods.

Would implementing the same logic in my custom editor inherited from BaseEditor would be correct? Was clearing of the editor meant to be always implemented manually for such cases? Or do I understand something incorrectly?

I’m sorry, I have no luck to implement this case in JsFiddle.

This is how my issue looks like (I use direct input into cell, do not double click on it):

Hi @Maximilian

I’m sorry about late reply. It will be hard to check this issue properly without a code demo. If it’s not replicable in jsFiddle maybe you can share a repository with the project? You can send it to us at support@handsontable.com

Hi @adrian.szymanski

That’s what I have in JSFiddle for now https://jsfiddle.net/taLef3dp/2/ but I cannot figure out why the error happens when you start editing.

My editor looks as simple as possible. It just extends BaseEditor. And if I do not add force clear of input in the “prepare” and “beginEditing” methods this issue appears on direct input into each next cell in the column.

Hi @Maximilian

I wasn’t able to narrow down which part of your editor is responsible for this error so I created one based on the steps from our documentation (I guess you used it too) and then change it from select to input and it works just fine: https://jsfiddle.net/2jc9vtfd/ In this case I would recommend to compare them both and see what is done differently, but it’s probably a small error.