diff --git a/src/compose/Compose.ts b/src/compose/Compose.ts index 5bf8f994..5007cee6 100644 --- a/src/compose/Compose.ts +++ b/src/compose/Compose.ts @@ -64,7 +64,7 @@ export class Compose extends FormElement { display: block; flex-grow: 1; --widget-box-shadow-focused: none; - --temba-textinput-padding: 1em 1em; + --temba-textinput-padding: 0.5em; } .actions { @@ -136,14 +136,14 @@ export class Compose extends FormElement { } .attachments { - min-height: 5em; - padding: 0.2em; + padding: 0.5em; align-items: center; display: flex; - background: #f9f9f9; border-radius: var(--curvature); - margin: 0.6em; - margin-bottom: 0em; + } + + temba-media-picker { + flex-grow: 1; } .pane-bottom { @@ -378,7 +378,7 @@ export class Compose extends FormElement { ) { this.langValues[this.currentLanguage] = { text: trimmed, - attachments: this.currentAttachments, + attachments: this.currentAttachments || [], quick_replies: this.currentQuickReplies.map((option) => option.value), optin: this.currentOptin.length > 0 ? this.currentOptin[0] : null, template: this.currentTemplate ? this.currentTemplate.uuid : null, @@ -432,6 +432,8 @@ export class Compose extends FormElement { } private handleChatboxChange(evt: Event) { + evt.preventDefault(); + evt.stopPropagation(); const chatbox = evt.target as Completion; const inputElement = chatbox.getTextInput().inputElement; @@ -638,28 +640,34 @@ export class Compose extends FormElement { .currentQuickReplies.length}|${showOptins}|${this .currentOptin}|${showTemplates}|${this.currentTemplate}" > - - ${this.attachments - ? html` -
+ + ${this.attachments + ? html`
-
-
` - : null} + > +
+ + +
+ +
` + : null} +
${this.quickReplies ? html` - - - + > `; } diff --git a/src/mediapicker/MediaPicker.ts b/src/mediapicker/MediaPicker.ts index f95aeaac..39ab3a92 100644 --- a/src/mediapicker/MediaPicker.ts +++ b/src/mediapicker/MediaPicker.ts @@ -289,7 +289,7 @@ export class MediaPicker extends RapidElement { if (this.uploading) { return html``; } else { - return this.attachments.length < this.max + return this.attachments.length < this.max && this.attachments.length >= 1 ? html`
+
${this.attachments.map((validAttachment) => { return html`
@@ -335,6 +336,7 @@ export class MediaPicker extends RapidElement { })} ${this.renderUploader()}
+
`; }