Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Chips have blank template when search text not found in items collection #3475

Closed
meassinal opened this issue Jun 26, 2015 · 10 comments
Closed
Assignees
Milestone

Comments

@meassinal
Copy link

When I check Chips in the demode, Chips work quite well when search text not found in collection. And I don't have any idea why I am having this problem. I am using Angularjs 1.4.0 and other dependencies.

screen shot 2015-06-26 at 3 48 57 pm

@ThomasBurleson ThomasBurleson modified the milestone: 0.11.0 Jul 6, 2015
@typotter typotter assigned typotter and unassigned topherfangio Aug 11, 2015
typotter pushed a commit to typotter/material that referenced this issue Aug 11, 2015
Properly set require-match=true in demos so that the value is correct in the components.
Check for requiredMatch on the controller instead of on the scope.

fixes angular#3475
typotter pushed a commit to typotter/material that referenced this issue Aug 11, 2015
Properly set require-match=true in demos so that the value is correct in the components.
Check for requiredMatch on the controller instead of on the scope.

fixes angular#3475
@metamatt
Copy link

@typotter do you also want to resolve #3900 and #4087 as dupes of this?

@typotter typotter added the pr: merge ready This PR is ready for a caretaker to review label Aug 12, 2015
@naomiblack naomiblack modified the milestones: 0.12.0, 0.11.0 Aug 14, 2015
kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
Properly set require-match=true in demos so that the value is correct in the components.
Check for requiredMatch on the controller instead of on the scope.

fixes angular#3475

closes angular#4108
@jherman
Copy link

jherman commented Oct 23, 2015

Still seeing this issue:
https://codepen.io/anon/pen/KdQJpW?editors=101

Type in "ca", cabbage will pop up and be auto selected. Hit 'enter'. You'll see two chips get added - what you searched for and the cabbage chip. Expecting only the cabbage chip.

@robertmesserle
Copy link
Contributor

Definitely seeing an issue in your codepen - reopening.

@robertmesserle robertmesserle added this to the 1.0-rc2 milestone Oct 23, 2015
@robertmesserle robertmesserle added priority: critical and removed pr: merge ready This PR is ready for a caretaker to review summit labels Oct 23, 2015
@jherman
Copy link

jherman commented Oct 23, 2015

In the mean time I've added the following line to fix the issue:

 if (angular.element(document.querySelectorAll("md-virtual-repeat-container:not(.ng-hide) li[md-virtual-repeat].selected")).length) return;

To:

MdChipsCtrl.prototype.appendChip = function (newChip) {
  if (angular.element(document.querySelectorAll("md-virtual-repeat-container:not(.ng-hide) li[md-virtual-repeat].selected")).length) return;
  if (this.useOnAppend && this.onAppend) {
    newChip = this.onAppend({'$chip': newChip});
  }
  if (this.items.indexOf(newChip) + 1) return;
  this.items.push(newChip);
};

There is probably a better way to handle this, but this get's me moving.

@danielgranat
Copy link

@jherman I'm facing the same issue, and I'm probably missing something, but adding the above line prevents from any of the chips from being added.

What do you think about the following suggestion to your line?

var selectedChip = angular.element(document.querySelectorAll("md-virtual-repeat-container:not(.ng-hide) li[md-virtual-repeat].selected"));
if (selectedChip.length && selectedChip.scope().item != newChip) return;

@jherman
Copy link

jherman commented Oct 28, 2015

That's strange that it's not working for you. I'm using v0.11.4 in case you are using something different. Regardless, since this is just a bandage for the time being, I would just do that if that fixes it for you. I imagine @robertmesserle is on the case now, and it'll be fixed relatively soon; which means I'll just be updating to the latest when it does get released.

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc2, 1.0-rc3 Oct 30, 2015
@topherfangio
Copy link
Contributor

@robertmesserle PR #5497 may fix this as well.

@robertmesserle
Copy link
Contributor

@topherfangio Can you let me know when that's merged in? I'll re-test once that's in.

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc3, 1.0-rc4 Nov 7, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc4, 1.0-rc5 Nov 16, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc5, 1.0-rc6 Nov 25, 2015
@jelbourn jelbourn assigned topherfangio and unassigned typotter Nov 26, 2015
@jelbourn
Copy link
Member

@topherfangio can you check if this is still an issue?

@topherfangio
Copy link
Contributor

@robertmesserle @jelbourn The Codepen above is no longer showing the issue (it uses HEAD), so I think this can be closed. Let me know if you think otherwise and we can reopen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants