Skip to content

Commit

Permalink
fix(channel-web): dropdown not rendering below message (#1764)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvitora authored Sep 21, 2023
1 parent bdba56a commit bbb0f6e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions modules/channel-web/assets/default-emulator.css
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,11 @@
margin: 0.2rem 0.5rem;
}

.bpw-in-message-quick_reply-dropdown {
margin: 0.2rem 0.5rem;
width: 200px;
}

.bpw-composer {
position: relative;
outline: none;
Expand Down
5 changes: 5 additions & 0 deletions modules/channel-web/assets/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@ body {
margin: 0.2rem 0.5rem;
}

.bpw-in-message-quick_reply-dropdown {
margin: 0.2rem 0.5rem;
width: 200px;
}

.bpw-composer {
border-top-width: 1px;
border-top-style: solid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Dropdown = (props: Renderer.Dropdown) => {

const renderSelect = inKeyboard => {
return (
<div className={inKeyboard && 'bpw-keyboard-quick_reply-dropdown'}>
<div className={(inKeyboard && 'bpw-keyboard-quick_reply-dropdown') || 'bpw-in-message-quick_reply-dropdown'}>
<div style={{ width: props.width || '100%', display: 'inline-block' }}>
{props.allowCreation ? (
<Creatable
Expand Down
5 changes: 5 additions & 0 deletions modules/hitlnext/assets/webchat-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,11 @@
padding: var(--spacing-medium) 0;
text-transform: uppercase;
}

.bpw-in-message-quick_reply-dropdown {
margin: 0.2rem 0.5rem;
width: 200px;
}
}

.bpw-emulator-header-tab + div {
Expand Down
7 changes: 3 additions & 4 deletions packages/ui-shared-lite/Payloads/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ const renderChoicePayload = (content: sdk.ChoiceContent & ExtraChoiceProperties)
component: 'Dropdown',
message: content.text,
buttonText: '',
displayInKeyboard: true,
displayInKeyboard: !content.displayInMessage,
options: content.choices.map(c => ({ label: c.title, value: c.value?.toUpperCase() })),
width: 300,
width: !content.displayInMessage && 300,
placeholderText: content.dropdownPlaceholder,
disableFreeText: content.disableFreeText,
displayInMessage: content.displayInMessage
disableFreeText: content.disableFreeText
}
}
return {
Expand Down

0 comments on commit bbb0f6e

Please sign in to comment.