Balbo Liu
Balbo Liu

Reputation: 60

monaco-editor: how to trigger backspace

I want to emulate keyboard event. but the code:

editor.trigger(monaco.KeyCode.Backspace, 'type')

not work,

it will not delete current char in editor.

Upvotes: 2

Views: 1246

Answers (1)

yurzui
yurzui

Reputation: 214047

For Backspace key monaco has specific core command called deleteLeft:

editor.trigger(monaco.KeyCode.Backspace, 'deleteLeft')

Upvotes: 1

Related Questions