Skip to content

Commit ef8cc9d

Browse files
committed
Pass focus/blur events and tabindex attr to textarea (fixes #162)
1 parent ca96635 commit ef8cc9d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

code-input.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var codeInput = {
3737
*/
3838
textareaSyncAttributes: [
3939
"value",
40+
"tabindex",
4041
// Form validation - https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation#using_built-in_form_validation
4142
"min", "max",
4243
"type",
@@ -70,7 +71,11 @@ var codeInput = {
7071
"change",
7172
"selectionchange",
7273
"invalid",
73-
"input"
74+
"input",
75+
"focus",
76+
"blur",
77+
"focusin",
78+
"focusout"
7479
],
7580

7681
/* ------------------------------------
@@ -957,6 +962,14 @@ var codeInput = {
957962
return val;
958963
}
959964

965+
// Synchronise blur and focus
966+
focus(options={}) {
967+
return this.textareaElement.focus(options);
968+
}
969+
blur(options={}) {
970+
return this.textareaElement.blur(options);
971+
}
972+
960973
/**
961974
* Get the placeholder of the code-input element that appears
962975
* when no code has been entered.

0 commit comments

Comments
 (0)