@clagentic/console 1.0.0-beta.1 → 1.0.0-beta.2
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/lib/public/modules/input.js +14 -1
- package/package.json +1 -1
|
@@ -1039,8 +1039,21 @@ export function initInput(_ctx) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
|
|
1041
1041
|
if (e.key === "Enter" && !e.shiftKey && !isComposing) {
|
|
1042
|
-
// Mobile: Enter inserts newline, send via button only
|
|
1042
|
+
// Mobile: Enter inserts newline, send via button only — except when
|
|
1043
|
+
// input is empty and a ghost suggestion is showing, in which case
|
|
1044
|
+
// Enter should adopt+send the suggestion (parity with desktop and
|
|
1045
|
+
// send-button behavior). hasSendableContent() guard ensures pasted
|
|
1046
|
+
// images/files still block ghost adoption. (lr-d46e)
|
|
1043
1047
|
if ("ontouchstart" in window) {
|
|
1048
|
+
if (!hasSendableContent() && !ctx.processing) {
|
|
1049
|
+
var ghostMobile = ctx.getGhostSuggestion ? ctx.getGhostSuggestion() : "";
|
|
1050
|
+
if (ghostMobile) {
|
|
1051
|
+
e.preventDefault();
|
|
1052
|
+
ctx.inputEl.value = ghostMobile;
|
|
1053
|
+
if (ctx.hideSuggestionChips) ctx.hideSuggestionChips();
|
|
1054
|
+
sendMessage();
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1044
1057
|
return;
|
|
1045
1058
|
}
|
|
1046
1059
|
e.preventDefault();
|
package/package.json
CHANGED