Skip to content

Commit

Permalink
fix(SearchBar): adjust text position
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengow committed Feb 19, 2022
1 parent d9d21d7 commit 93c38bd
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions components/rmrk/Gallery/Search/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@
</div>
</template>
</b-autocomplete>
<div
v-if="searchQuery"
:class="{ 'ml-4': true, 'is-size-4': isVisible || !sliderDirty }">
<div>Showing results for {{ searchQuery }}</div>
<div v-if="!isVisible && sliderDirty" class="is-size-7">
Prices ranging from {{ this.query.priceMin / 1000000000000 }} to
{{ this.query.priceMax / 1000000000000 }}
</div>
</div>
</b-field>
<b-field
expanded
Expand All @@ -96,9 +105,6 @@
<slot />
</b-field>
</div>
<div v-if="searchQuery" class="mb-3">
<span>Showing results for {{ searchQuery }}</span>
</div>
<b-collapse
aria-id="sortAndFilter"
animation="opacitySlide"
Expand All @@ -123,11 +129,11 @@
ticks
@change="sliderChange">
</b-slider>
<span v-if="sliderDirty"
>Prices ranging from {{ this.query.priceMin / 1000000000000 }} to
{{ this.query.priceMax / 1000000000000 }}</span
>
</b-collapse>
<span v-if="query.priceMin !== undefined && query.priceMax !== undefined">
Prices ranging from {{ this.query.priceMin / 1000000000000 }} to
{{ this.query.priceMax / 1000000000000 }}
</span>
</div>
</template>

Expand Down Expand Up @@ -189,6 +195,7 @@ export default class SearchBar extends mixins(
private highlightPos = 0
private rangeSlider = [0, 5]
private inputDirty = false
private sliderDirty = false
public mounted(): void {
this.getSearchHistory()
Expand Down Expand Up @@ -478,6 +485,9 @@ export default class SearchBar extends mixins(
@Debounce(50)
private sliderChange([min, max]: [number, number]): void {
if (!this.sliderDirty) {
this.sliderDirty = true
}
this.sliderChangeMin(min * 1000000000000)
this.sliderChangeMax(max * 1000000000000)
const priceMin = String(min)
Expand Down

0 comments on commit 93c38bd

Please sign in to comment.