Behavior undo (ctrl + z) for kendo-textbox and kendo-textarea

1 Answer 79 Views
TextArea TextBox
Andrii
Top achievements
Rank 1
Andrii asked on 30 Aug 2024, 09:43 AM

Hi.

The default behavior of pressing ctrl + z is to undo the last character entered. But if you enter several letters in kendo-textbox and kendo-textarea and press ctrl + z, all the entered letters are undo.

However, kendo-autocomplete or kendo-combobox only undo the last character when pressing ctrl + z.
How can I return the default undo behavior for kendo-textbox and kendo-textarea (undo only the last character entered)?

Thanks.

angular 17.3.7

kendo 16.4.0

 

1 Answer, 1 is accepted

Sort by
0
Zornitsa
Telerik team
answered on 04 Sep 2024, 07:04 AM

Hi Andrii,

In general, the default behavior of the CTRL+Z keyboard shortcut (the undo operation) is to undo the last performed action by the user. On that note, the standard CTRL+Z behavior of the regular HTML <input> and <textarea> elements is that it undoes the entire entered text in the input field since the last focus rather than undoing character by character.

In this line of thought, the explained scenario with our TextBox and TextArea components is expected since this is the default undo behavior of the HTML <input> and <textarea> elements as well. 

This means that if the user enters multiple characters in a row without losing the focus of the element, the CTRL+Z operation will undo the whole sequence of characters. On the other hand, if the focus of the element is lost and then other characters are entered, the last sequence will be undone.  

For better demonstration, I prepared a StackBlitz example, in which you can try out the undo behavior for both our components and the regular HTML elements and see how it is the same:

I hope the provided information sheds some light on the matter.

Regards,
Zornitsa
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Andrii
Top achievements
Rank 1
commented on 04 Sep 2024, 08:50 AM

Thank you, your answer was very helpful.
Tags
TextArea TextBox
Asked by
Andrii
Top achievements
Rank 1
Answers by
Zornitsa
Telerik team
Share this question
or