Angular Material DatePicker Autocomplete

Discussão em 'Angular' iniciado por j0w, Novembro 19, 2024.

  1. j0w

    j0w Guest

    trying to implement a searchbar where you can search by the item's name or by a date. just wanted to know if there's a way to disable the datepicker autocomplete?

    problem is : - if i do a search by date, it's fine - if i do a search by name it's ok... untill i loose focus of search input, then it autocomplete with a date

    example : if i search an item with 1234 in it and loose focus of the search input, it will complete with 01/01/1234 and do the research with it...

    <mat-form-field id="search">
    <input i18n-placeholder="Search@@searchBar" matInput placeholder="Search..."
    [matDatepicker]="picker" (dateInput)="searchDate($event)" #input />
    <mat-icon matPrefix>search</mat-icon>
    </mat-form-field>

    <span>
    <mat-datepicker-toggle [for]="picker"></mat-datepicker-toggle>
    <mat-datepicker #picker ></mat-datepicker>
    </span>


    Maybe i'm just doing it the wrong way...? Regards j0w

    Continue reading...

Compartilhe esta Página