Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(option): Fixes an issue with the scrollbar on firefox causing tex…
Browse files Browse the repository at this point in the history
…t to be cut short unintentionally.
  • Loading branch information
rowa-audil authored and lukasholzer committed Oct 12, 2020
1 parent 2da4670 commit 928ff1d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
7 changes: 7 additions & 0 deletions libs/barista-components/autocomplete/src/autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ $dt-autocomplete-panel-min-width: 112px !default;
-webkit-overflow-scrolling: touch; // for momentum scroll on mobile
}

@supports (-moz-appearance: none) {
.dt-autocomplete-panel {
width: calc(100% + 20px);
flex-shrink: 0; // to not shrink on FF if there is a scroll bar
}
}

.dt-autocomplete-hidden {
display: none;
}
3 changes: 3 additions & 0 deletions libs/barista-components/core/src/option/option.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<span class="dt-option-label">
<ng-content></ng-content>
</span>
23 changes: 16 additions & 7 deletions libs/barista-components/core/src/option/option.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

:host {
@include dt-main-font();
display: block;
position: relative;
cursor: pointer;
outline: none;
display: flex;
flex-direction: row;
max-width: 100%;
box-sizing: border-box;
align-items: center;
padding: 0 12px;
font-size: 14px;
line-height: 28px;
cursor: default;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
outline: none;
font-variant: tabular-nums;

&:not(.dt-option-disabled).dt-option-active {
background-color: $turquoise-100;
Expand All @@ -27,3 +28,11 @@
color: $disabledcolor;
}
}

.dt-option-label {
display: inline-block;
flex-grow: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
2 changes: 1 addition & 1 deletion libs/barista-components/core/src/option/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class DtOptionSelectionChange<T> {
class: 'dt-option',
},
styleUrls: ['option.scss'],
template: '<ng-content></ng-content>',
templateUrl: 'option.html',
encapsulation: ViewEncapsulation.Emulated,
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down

0 comments on commit 928ff1d

Please sign in to comment.