feat: configurable Enter/Shift+Enter send behavior in embedded chat (#32295) (#32300)

This commit is contained in:
agent-steven
2026-03-10 12:44:11 +09:00
committed by GitHub
parent 504138bb23
commit 2a3cc2951b
5 changed files with 35 additions and 2 deletions

View File

@ -58,6 +58,15 @@ const ChatWrapper = () => {
appSourceType,
} = useEmbeddedChatbotContext()
// Read sendOnEnter from URL params (e.g., ?sendOnEnter=false)
const sendOnEnter = useMemo(() => {
if (typeof window === 'undefined')
return true
const urlParams = new URLSearchParams(window.location.search)
const param = urlParams.get('sendOnEnter')
return param !== 'false'
}, [])
const appConfig = useMemo(() => {
const config = appParams || {}
@ -321,6 +330,7 @@ const ChatWrapper = () => {
themeBuilder={themeBuilder}
switchSibling={doSwitchSibling}
inputDisabled={inputDisabled}
sendOnEnter={sendOnEnter}
questionIcon={
initUserVariables?.avatar_url
? (