minitel-standalone
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -72,4 +72,3 @@ "use strict"; | ||
default: | ||
if (/^[a-zA-Z0-9,\.';\-\:?!"#$%&\(\)\[\]<>@+=*/\x0d ]$/g.test(key)) { | ||
this.lastFocusCursorX = this.cursorActuallyAt[1]; | ||
if (/^[a-zA-Z0-9,\.';\-\:?!"#$%&\(\)\[\]<>@+=*/ ]$/g.test(key) || (key === '\x0d' && !this.attributes.multiline)) { | ||
const lines = this.value.split('\n'); | ||
@@ -82,3 +81,2 @@ let cumulPosition = lines.filter((_, i) => i < this.cursorActuallyAt[0]).reduce((p, v) => p + v.length + 1, 0); | ||
if (key === '\x0d') { | ||
this.lastFocusCursorX = 0; | ||
this.cursorActuallyAt[1] = 0; | ||
@@ -90,2 +88,3 @@ this.cursorActuallyAt[0] += 1; | ||
} | ||
this.lastFocusCursorX = this.cursorActuallyAt[1]; | ||
if (this.attributes.onChange) | ||
@@ -92,0 +91,0 @@ this.attributes.onChange(this); |
{ | ||
"name": "minitel-standalone", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A standalone package for minitel components", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -103,5 +103,3 @@ import { Focusable, FocusableAttributes } from '../abstract/focusable.js'; | ||
default: | ||
if (/^[a-zA-Z0-9,\.';\-\:?!"#$%&\(\)\[\]<>@+=*/\x0d ]$/g.test(key)) { | ||
this.lastFocusCursorX = this.cursorActuallyAt[1]; | ||
if (/^[a-zA-Z0-9,\.';\-\:?!"#$%&\(\)\[\]<>@+=*/ ]$/g.test(key) || (key === '\x0d' && !this.attributes.multiline)) { | ||
const lines = this.value.split('\n'); | ||
@@ -115,3 +113,2 @@ | ||
if (key === '\x0d') { | ||
this.lastFocusCursorX = 0; | ||
this.cursorActuallyAt[1] = 0; | ||
@@ -122,2 +119,3 @@ this.cursorActuallyAt[0] += 1; | ||
} | ||
this.lastFocusCursorX = this.cursorActuallyAt[1]; | ||
@@ -124,0 +122,0 @@ if (this.attributes.onChange) this.attributes.onChange(this); |
179937
3854