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

md-chips that include an autocomplete throw an exception when they are readonly. #2841

Closed
ddimitrop opened this issue May 13, 2015 · 12 comments
Labels
pr: merge ready This PR is ready for a caretaker to review resolution: fixed
Milestone

Comments

@ddimitrop
Copy link

Codepen example

http://codepen.io/ddimitrop/pen/OVNjbd

There is an exception in dev console

TypeError: Cannot read property 'registerSelectedItemWatcher' of undefined
at MdChipsCtrl.configureAutocomplete (angular-material.js:11978)
at angular-material.js:12242
at angular.js:16299
at completeOutstandingRequest (angular.js:4924)
at angular.js:5312

in line

.configureAutocomplete(element.find('md-autocomplete')

there is no guarantee that the compiled chipInputTemplate will include an actual auto-complete just because it was in the source

@cognitronic
Copy link

I'm having this issue all of a sudden and I'm not exactly clear as to why. Is there a way to get around this for the time being?

@robertmesserle robertmesserle modified the milestones: 0.11.0, 0.10.0 Jun 16, 2015
@stewones
Copy link

+1

1 similar comment
@Millen31
Copy link

+1

@ryanovas
Copy link

anyone have a temporary workaround until this is fixed?

@Kyoss79
Copy link

Kyoss79 commented Jun 26, 2015

+1

@charliewynn
Copy link

+1 but I have a workaround for now..

  1. ditch the readonly property for md-chips
  2. use your readonly var for the autocomplete's ng-disabled
  3. use a custom md-chip template
  4. add an ng-hide to the md-chip-remove button with your readonly var

@yochayme
Copy link

+1

topherfangio added a commit that referenced this issue Aug 12, 2015
When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

fixes #2841
@topherfangio topherfangio added the pr: merge ready This PR is ready for a caretaker to review label Aug 12, 2015
topherfangio added a commit that referenced this issue Aug 13, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes #2841, fixes #3482
topherfangio added a commit that referenced this issue Aug 13, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes #2841, fixes #3482
topherfangio added a commit that referenced this issue Aug 13, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes #2841, fixes #3482
@rafidka
Copy link

rafidka commented Sep 20, 2015

+1

@topherfangio
Copy link
Contributor

@rafidka Are you still seeing this in 0.11? We pushed a fix in 3e8c994.

@rafidka
Copy link

rafidka commented Sep 22, 2015

@topherfangio I think I am still on 0.10, I will try the new one and let you know.

kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes angular#2841, fixes angular#3482. closes angular#4133.
@rafidka
Copy link

rafidka commented Oct 2, 2015

@topherfangio sorry for the late response. I tried Angular 0.11 and it indeed solved it. Thanks!.

rafidka added a commit to hadithhouse/HadithHouseApi that referenced this issue Oct 3, 2015
I tried to use them before but they caused some problems as mentioned
in this issue:

angular/material#2841

However, it got fixed in v0.11 as mentioned in this comment:

angular/material#2841 (comment)
rafidka added a commit to hadithhouse/HadithHouseApi that referenced this issue Jan 26, 2016
I tried to use them before but they caused some problems as mentioned
in this issue:

angular/material#2841

However, it got fixed in v0.11 as mentioned in this comment:

angular/material#2841 (comment)
@waratah
Copy link

waratah commented Jan 17, 2018

For those that end up here searching only...

TypeError: Cannot read property 'some' of undefined
at MdChipsCtrl.appendChip

This is caused by an undefined in ng-model

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review resolution: fixed
Projects
None yet