Skip to content

Commit

Permalink
Move search bar out of list header to fix typing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxroehrl committed Oct 21, 2020
1 parent eac6dcf commit f80923c
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions app/components/Subreddits.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<template>
<StackLayout @loaded="loaded($event)">
<SearchBar ref="searchbar"
v-model="searchText"
hint="Search for subreddit"
class="searchbar"
@loaded="searchbarLoaded"
@textChange="onSearchTextChanged"
@submit="onSubmit"
@clear="onClear" />
<RadListView ref="subredditList" for="subreddit in subredditList">
<v-template name="header">
<SearchBar ref="searchbar"
v-model="searchText"
hint="Search for subreddit"
class="searchbar"
@loaded="searchbarLoaded"
@textChange="onSearchTextChanged"
@submit="onSubmit"
@clear="onClear" />
</v-template>
<v-template>
<StackLayout orientation="horizontal"
padding="0"
Expand All @@ -31,7 +29,6 @@
import Reddit from '../services/Reddit';
import {ObservableArray} from '@nativescript/core/data/observable-array';
import store from '../store';
import {ad} from '@nativescript/core/utils/utils';
export default {
name: 'Subreddits',
Expand Down Expand Up @@ -115,7 +112,6 @@ export default {
if (result?.names) {
this.subredditList = new ObservableArray(result.names.map((s) => ({display_name: s})));
this.refreshList();
setTimeout(() => this.$refs.searchbar.nativeView.focus(), 500);
}
});
}
Expand All @@ -127,7 +123,6 @@ export default {
onClear() {
this.displaySubscriptions();
setTimeout(() => ad.dismissSoftInput(), 50);
},
searchbarLoaded(event) {
Expand Down

0 comments on commit f80923c

Please sign in to comment.