Giter Site home page Giter Site logo

Comments (17)

Markus-Ende avatar Markus-Ende commented on May 22, 2024 62

if it was to not work, why did you guys build it????????????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!wtf

Please be respectful, this is open source work you don't have to use.

from ngx-mask.

NepipenkoIgor avatar NepipenkoIgor commented on May 22, 2024 44

@dgouissem We used ValueAccessor in our current realization, but angular have limitation -> we can use only one realization ValueAccessor. That why ngx-mask don't work with material.

from ngx-mask.

rafaelgoncalves2010 avatar rafaelgoncalves2010 commented on May 22, 2024 36

if it was to not work, why did you guys build it????????????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!wtf

from ngx-mask.

jongbonga avatar jongbonga commented on May 22, 2024 28

still not fix here?

from ngx-mask.

aemonge avatar aemonge commented on May 22, 2024 17

Still the recommended option is not to use this library ?

from ngx-mask.

muneebshafiq avatar muneebshafiq commented on May 22, 2024 5

[UPDATE]
I don't know where previous link was redirecting but correct link is here
ng-bootstrap/ng-bootstrap#2291 (comment)

Basically use Racoon mask instead of ngx-mask

from ngx-mask.

Markus-Ende avatar Markus-Ende commented on May 22, 2024 4

@dgouissem We used ValueAccessor in our current realization, but angular have limitation -> we can use only one realization ValueAccessor. That why ngx-mask don't work with material.

Could you please add this as a big disclaimer in the documentation?

from ngx-mask.

ashkan-dev-86 avatar ashkan-dev-86 commented on May 22, 2024 3

Has anyone found a simpler solution?

There is no simple solution

from ngx-mask.

deividfortuna avatar deividfortuna commented on May 22, 2024 2

There is a workaround solution not using ngx-mask library
Take a look in this issue: angular/angular#16755

from ngx-mask.

NepipenkoIgor avatar NepipenkoIgor commented on May 22, 2024

@dgouissem Thanks, we will check

from ngx-mask.

benj0c avatar benj0c commented on May 22, 2024

I have the same problem when try to use mask in combination with bsDatepicker.

<div class="form-group">
    <label class="control-label col-lg-2 text-right">Birthday</label>
    <div class="col-lg-4">
        <input type="text" class="form-control" formControlName="birthday" placeholder="MM/DD/YYYY"  mask="00/00/0000" autocomplete="off" bsDatepicker>
    </div>
</div>

from ngx-mask.

ravenda900 avatar ravenda900 commented on May 22, 2024

I manage to create a workaround that works perfectly based on my expectation. I created a hidden input that handles the datepicker, the mask itself is attached to the actual input that is visible and added a event listener dateSelect to set the value from the date picker to the actual input with mask.

EDIT: I also added the positionTarget input to make the datepicker look that its been initialized in the actual input

<div class="input-group">
  <input type="text" class="form-control" #startDateInput id="startDate" formControlName="startDate" [leadZeroDateTime]="true" mask="d0/M0/0000" />
  <input type="hidden" (dateSelect)="onDateSelect($event, 'startDate')" ngbDatepicker #start="ngbDatepicker" [positionTarget]="startDateInput">
  <button class="btn" (click)="start.toggle()" type="button">
  <i class="mdi mdi-calendar"></i>
  </button>
</div>
onDateSelect(date: NgbDate, key: string): void {
    const formControl: any = {};
    formControl[key] = this.dateAdapter.toModel(date);
    this.form.patchValue(formControl);
}

ezgif com-gif-maker

from ngx-mask.

toniellenk avatar toniellenk commented on May 22, 2024

there's another way here too: ng-bootstrap/ng-bootstrap#2291 (comment).
use RacoonMask and NativeDateAdapter.

from ngx-mask.

marcosvmauri avatar marcosvmauri commented on May 22, 2024

I manage to create a workaround that works perfectly based on my expectation. I created a hidden input that handles the datepicker, the mask itself is attached to the actual input that is visible and added a event listener dateSelect to set the value from the date picker to the actual input with mask.

EDIT: I also added the positionTarget input to make the datepicker look that its been initialized in the actual input

<div class="input-group">
  <input type="text" class="form-control" #startDateInput id="startDate" formControlName="startDate" [leadZeroDateTime]="true" mask="d0/M0/0000" />
  <input type="hidden" (dateSelect)="onDateSelect($event, 'startDate')" ngbDatepicker #start="ngbDatepicker" [positionTarget]="startDateInput">
  <button class="btn" (click)="start.toggle()" type="button">
  <i class="mdi mdi-calendar"></i>
  </button>
</div>
onDateSelect(date: NgbDate, key: string): void {
    const formControl: any = {};
    formControl[key] = this.dateAdapter.toModel(date);
    this.form.patchValue(formControl);
}

ezgif com-gif-maker

Please, can you help me.
I'm getting error Cannot find name 'DateAdapter'
When I implement this code

from ngx-mask.

gitalvininfo avatar gitalvininfo commented on May 22, 2024

Hi @NepipenkoIgor

May I ask if what is the status of this issue? I wish to implement a proper solution, not a workaround although it is working fine.
I am using ngbDatepicker of ng-bootstrap (Angular 11) and having this error in console

Error: More than one custom value accessor matches form control with unspecified name attribute.

Thank you.

from ngx-mask.

Leomhl avatar Leomhl commented on May 22, 2024

Same issue here :/

from ngx-mask.

mhagnumdw avatar mhagnumdw commented on May 22, 2024

Has anyone found a simpler solution?

from ngx-mask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.