Skip to content

Commit

Permalink
fix(ui): handle long text in BuilderSelect
Browse files Browse the repository at this point in the history
The `BuilderSelect` trigger has overflow issues with long text
containing breakable content. The trick was just a missing `white-space:
nowrap` rule.

I also took the opportunity to add a tooltip to the `BuilderSelect`'s
trigger.
  • Loading branch information
madeindjs committed Dec 18, 2024
1 parent 22d0248 commit ed254ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui/src/builder/BuilderSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<button
class="BuilderSelect__trigger"
role="button"
:data-writer-tooltip="currentLabel"
@click="isOpen = !isOpen"
>
<i v-if="!hideIcons" class="material-symbols-outlined">{{
Expand Down Expand Up @@ -141,6 +142,7 @@ function onSelect(value: string) {
overflow: hidden;
flex-grow: 1;
text-align: left;
white-space: nowrap;
}
.BuilderSelect__trigger__arrow {
border: none;
Expand Down
1 change: 1 addition & 0 deletions src/ui/src/builder/BuilderTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ onUnmounted(() => {
display: content;
max-width: 260px;
filter: drop-shadow(0px 0px 12px rgba(0, 0, 0, 0.16));
word-break: break-all;
}
.arrow {
Expand Down
1 change: 1 addition & 0 deletions src/ui/src/wds/WdsDropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ watch(searchTerm, () => emits("search", searchTerm.value));
}
.WdsDropdownMenu__item__label {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: left;
}
Expand Down

0 comments on commit ed254ba

Please sign in to comment.