I have a horizontally scrollable ion-toolbar:
After setting one of these filters, an extra option becomes available which enables removal of the selection.
But, when the toolbar is not at horizontal scroll position 0, and a filter is selected, the toolbars horizontal scroll value does not reset. This results in the following:
I have been searching for the correct property to set for some time now, but i am unable to get it functional.
The css making it scrollable:
ion-toolbar.scrollable-segments {
display: block;
overflow: scroll;
white-space: nowrap;
margin: 0px 0px 0px 0px;
min-height: 0px;
}
ion-toolbar.scrollable-segments .toolbar-background {
background: transparent;
}
ion-toolbar.scrollable-segments::-webkit-scrollbar {
height: 0;
width: 0;
display: none;
}
ion-toolbar.scrollable-segments ion-button {
display: inline-block;
width: auto;
}
HTML
<ion-toolbar no-border class="scrollable-segments" id="filterbar">
<button color="primary" ion-button round small *ngIf="filtered" (click)="removeFilters()"> <p>wissen</p></button>
<button color="secondary" *ngFor="let filter of filters" ion-button round small [outline]="!filter.active" (click)="goToFilter(filter)">
<p>{{filter.name}}</p>
<p *ngIf="filter.active && (filter.name !== 'Land' || !singleCountry) " >({{filter.amount}})</p>
<span *ngIf="singleCountry && filter.name === 'Land'" [class]="selectedCountryIcon()"></span>
</button>
</ion-toolbar>
I would like so know how to programmatically reset the horizontal scroll, or set it to 0.
Thanks