js_lis 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VirtualKeyboard.js +17 -2
- package/package.json +1 -1
package/VirtualKeyboard.js
CHANGED
|
@@ -256,9 +256,24 @@ export class VirtualKeyboard {
|
|
|
256
256
|
await this.insertText("\t");
|
|
257
257
|
break;
|
|
258
258
|
|
|
259
|
-
case
|
|
259
|
+
case 'Enter':
|
|
260
260
|
if (this.currentInput.tagName === "TEXTAREA") {
|
|
261
|
-
|
|
261
|
+
const start = this.currentInput.selectionStart;
|
|
262
|
+
const end = this.currentInput.selectionEnd;
|
|
263
|
+
const value = this.currentInput.value;
|
|
264
|
+
this.currentInput.value = value.slice(0, start) + "\n" + value.slice(end);
|
|
265
|
+
this.currentInput.setSelectionRange(start + 1, start + 1);
|
|
266
|
+
} else if (this.currentInput.tagName === "INPUT" || this.currentInput.type === "password" || this.currentInput.type === "text") {
|
|
267
|
+
if (this.currentInput.form) {
|
|
268
|
+
const submitButton = this.currentInput.form.querySelector('input[type="submit"], button[type="submit"], button[type="button"], button[onclick]');
|
|
269
|
+
if (submitButton) {
|
|
270
|
+
submitButton.click();
|
|
271
|
+
} else {
|
|
272
|
+
this.currentInput.form.submit();
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
this.currentInput.value += '\n';
|
|
276
|
+
}
|
|
262
277
|
}
|
|
263
278
|
break;
|
|
264
279
|
|