Make autofocus works in text editor

This commit is contained in:
Frederic Guillot
2016-11-27 18:57:05 -05:00
parent 453513da29
commit 0c426c6d99
4 changed files with 7 additions and 4 deletions

View File

@@ -10,6 +10,10 @@ KB.component('text-editor', function (containerElement, options) {
.add(viewModeElement)
.add(writeModeElement)
.build());
if (options.autofocus) {
textarea.focus();
}
};
function buildViewMode() {
@@ -50,7 +54,6 @@ KB.component('text-editor', function (containerElement, options) {
.attr('name', options.name)
.attr('tabindex', options.tabindex || '-1')
.attr('required', options.required || false)
.attr('autofocus', options.autofocus || null)
.text(options.text) // Order is important for IE11
.attr('placeholder', options.placeholder || null)
.build();