We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 17c9f16 + a010e3e commit 5061afcCopy full SHA for 5061afc
1 file changed
code-input.js
@@ -5,6 +5,7 @@
5
var codeInput = {
6
observedAttributes: [
7
"value",
8
+ "name",
9
"placeholder",
10
"lang",
11
"template",
@@ -156,7 +157,6 @@ var codeInput = {
156
157
158
if (this.getAttribute("name")) {
159
textarea.setAttribute("name", this.getAttribute("name")); // for use in forms
- this.removeAttribute("name");
160
}
161
162
textarea.setAttribute("oninput", "this.parentElement.update(this.value); this.parentElement.sync_scroll();");
@@ -208,7 +208,12 @@ var codeInput = {
208
209
case "value":
210
this.update(newValue);
211
-
+ break;
212
+
213
+ case "name":
214
+ if(this.querySelector("textarea") !== null) {
215
+ this.querySelector("textarea").setAttribute("name", newValue); // for use in forms
216
+ }
217
break;
218
219
case "placeholder":
0 commit comments