Skip to content

Cancel button of ion-searchbar not working probably? V4 #15171

@a7md0

Description

@a7md0

Bug Report

Ionic Info

Ionic:
   ionic (Ionic CLI)          : 4.0.6
   Ionic Framework            : @ionic/angular 4.0.0-beta.2
   @angular-devkit/core       : 0.7.3
   @angular-devkit/schematics : 0.7.3
   @angular/cli               : 6.1.3
   @ionic/ng-toolkit          : 1.0.6
   @ionic/schematics-angular  : 1.0.4

Describe the Bug
When using ion-searchbar and click the cancel button (back arrow) should navigate me to another page. This functionally is working on the mobile browser but on the desktop browser is does not work? (nothing happened when clicking on cancel button)

Steps to reproduce the behaviour:

  1. Click on the search box
  2. Click the cancel button (back arrow)

Related Code
.html
<ion-searchbar showCancelButton=true (ionCancel)="onCancel($event)"></ion-searchbar>
.ts
onCancel(event) { this.router.navigateByUrl('/home'); }

Expected Behavior
The cancel button should trigger function which goes back to homepage using Router.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions