chore: multiline traversal support (#51)
Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
7
vendor/ink-text-input/build/index.js
vendored
7
vendor/ink-text-input/build/index.js
vendored
@@ -46,7 +46,7 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
|
||||
return;
|
||||
}
|
||||
// Treat Escape as a control key (don't insert into value)
|
||||
if (key.escape || key.upArrow || key.downArrow || (key.ctrl && input === 'c') || key.tab || (key.shift && key.tab)) {
|
||||
if (key.escape || (key.ctrl && input === 'c') || key.tab || (key.shift && key.tab)) {
|
||||
return;
|
||||
}
|
||||
if (key.return) {
|
||||
@@ -68,6 +68,11 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
|
||||
nextCursorOffset++;
|
||||
}
|
||||
}
|
||||
else if (key.upArrow || key.downArrow) {
|
||||
// Handle wrapped line navigation - don't handle here, let parent decide
|
||||
// Parent will check cursor position to determine if at boundary
|
||||
return;
|
||||
}
|
||||
else if (key.backspace || key.delete) {
|
||||
if (cursorOffset > 0) {
|
||||
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
||||
|
||||
Reference in New Issue
Block a user