简体   繁体   中英

textChange of searchbar in TabView only triggered once

I have a tab component with a search component. This component exists of a searchbar with textChange-event. The event is triggered once when the app is starting and then never again. Same code works perfectly when not part of the tabview.

The tabview (shortened):

<TabView id="tabview1" (selectedIndexChanged)="onSelectedIndexChanged($event)">
    <StackLayout *tabItem="{title: 'search' | L, iconSource: getIconSource('search')}">
        <Search></Search>
    </StackLayout>
</TabView>

The search component looks like this:

<Page>        
    <StackLayout>
        <SearchBar [text]="searchPhrase" (textChange)="onTextChanged($event)"></SearchBar>
    </StackLayout>
<Page>

onTextChanged() only prints (or rather would print) the new text to the console.

Any idea how to solve this?

The problem was the page in my search component. After removing it, the event gets triggered as intended.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM