Click on cross icon

Dear Team,

In mobile view I want click event of cross icon(clear) where I can put some custom logic.

Regards

Nagendra Gupta


1 Reply 1 reply marked as answer

SP Sureshkumar P Syncfusion Team September 21, 2022 01:53 PM UTC

Hi Nagendra,

In our dropdownlist component when clicking the cross icon, the components change event triggers. So, we suggest you use the change event to perform your custom logic.

Find the code example here:

public onChange(args: any): void {

    if (args.e.target.classList.contains('e-clear-icon')) {

      // excecute when click the clear icon

    }

  }

 


To know more about the change event. Please refer to the API documentation link: https://ej2.syncfusion.com/angular/documentation/api/drop-down-list#change

Find the sample here: https://stackblitz.com/edit/angular-mf29yw?file=app.component.html,app.component.ts

Note: If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.

Regards,

Sureshkumar P



Marked as answer
Loader.
Up arrow icon