Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiselet calendar don't update ngModel on unselect date #3876

Closed
sgodoy opened this issue Sep 7, 2017 · 10 comments
Closed

Multiselet calendar don't update ngModel on unselect date #3876

sgodoy opened this issue Sep 7, 2017 · 10 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@sgodoy
Copy link

sgodoy commented Sep 7, 2017

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/vG1QBJQuTVyEbhQRyM7s?p=preview

Current behavior
Multiselet calendar don't update ngModel when unselect date, until I select another one.

Expected behavior
Unselected date must update ngModel

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/vG1QBJQuTVyEbhQRyM7s?p=preview

1- Select two or more dates
2- Unselect a date
3- Displayed dates don't update

What is the motivation / use case for changing the behavior?
Can't unselect dates if I not select another one after

Please tell us about your environment:
Windows 7, Visual Studio Code.

  • Angular version:
    ^4.0.0

  • PrimeNG version:
    ^4.2.0-rc.1

  • Browser:
    Chrome 60.0.3112.113 (64 bits)
    Firefox 55.0.3 (32-bit)

  • Language:
    TypeScript ~2.3.3

  • Node (for AoT issues): node --version = 8.2.1

@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Oct 20, 2017
@cagataycivici cagataycivici added this to the 4.2.3 milestone Oct 20, 2017
@cagataycivici
Copy link
Member

I'm unable to replicate the issue. Feel free to attach a screencast.

@cagataycivici cagataycivici removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Oct 23, 2017
@cagataycivici cagataycivici removed this from the 4.2.3 milestone Oct 23, 2017
@DRSchallerSS
Copy link

I've been waiting for this issue to be resolved as I can also replicate the issue in my project. The link to the plunker in the original issue message above clearly replicates the issue.
This issue should not be closed

Here are the steps to replicate the issue of the model not updating:

  • Open the Plunker link
  1. Click the calendar icon
  2. Click multiple dates on the calendar.
    2a. Note that the dates are displayed behind the calendar ( {{fechas}} ), clicking off to hide the calendar will show the text of the selected dates as they are slightly hidden by the calendar
  3. Open the calendar and deselect the dates highlighted
    3a. Note that the calendar dates displayed on the screen do not change.
  4. Open the calendar, select a non selected date, the model updates and the dates displayed are changed.

@sgodoy
Copy link
Author

sgodoy commented Oct 23, 2017

Hi, here is a gif replicating the problem, it follow the steps given by @DRSchallerSS

GIF replicating the problem

@fusionart
Copy link

I also have the same issue as sgodoy is showning on the gif.

@DRSchallerSS
Copy link

Does a new issue have to be opened to have this addressed?

@med-doulfakar
Copy link

Am always having the same issue ! is there any fix ?

alex-druzhinin added a commit to alex-druzhinin/primeng that referenced this issue Dec 13, 2017
@cagataycivici cagataycivici reopened this Jan 22, 2018
@cagataycivici cagataycivici changed the title Multiselet calendar don't update ngModel when unselect date, until I select another one. Multiselet calendar don't update ngModel on unselect date Jan 22, 2018
@cagataycivici cagataycivici added this to the 5.2.0-RC2 milestone Jan 22, 2018
@cagataycivici cagataycivici self-assigned this Jan 22, 2018
@gklprsna
Copy link

Friends those who need a quick fix and can't wait upto next update can try this,
->Locate your calendar.js file inside /node_modules/primeng/calendar/
-> Replace the below lines with the if condition starting from line number 302 on your calendar.js file.

if (this.isMultipleSelection() && this.isSelected(dateMeta)) {
// this.value = this.value.filter(function (date, i) {
// return !_this.isDateEquals(date, dateMeta);
// });
var temp = this.value.filter(function(date, i) {
return !_this.isDateEquals(date, dateMeta);});
this.updateModel(temp);
}

The above solution works for me..

@xyrintech
Copy link

Issue is still there.

May I know which version this is being resolved in?
I am using 4.1.3

@xyrintech
Copy link

I have tried 4.3.0 and this issue is till there

@lucasnguyen3979
Copy link

lucasnguyen3979 commented Aug 10, 2018

This issue just fixed from 5.2.0-rc2, @cagataycivici can you fix it in 4.3.0 please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

8 participants