Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Textarea placeholder binding causes exception in IE11 #5025

Closed

Description

@provegard

See the following fiddle:

http://jsfiddle.net/provegard/wLBwd/

While the correct placeholder appears, I also get the following stack trace in the console:

Error: Invalid argument.
   at interpolateFnWatchAction (http://code.angularjs.org/1.2.1/angular.js:6366:15)
   at $digest (http://code.angularjs.org/1.2.1/angular.js:11443:21)
   at $apply (http://code.angularjs.org/1.2.1/angular.js:11682:13)
   at Anonymous function (http://code.angularjs.org/1.2.1/angular.js:1285:9)
   at invoke (http://code.angularjs.org/1.2.1/angular.js:3616:18)
   at doBootstrap (http://code.angularjs.org/1.2.1/angular.js:1283:5)
   at bootstrap (http://code.angularjs.org/1.2.1/angular.js:1297:5)
   at angularInit (http://code.angularjs.org/1.2.1/angular.js:1246:5)
   at Anonymous function (http://code.angularjs.org/1.2.1/angular.js:20126:5)
   at trigger (http://code.angularjs.org/1.2.1/angular.js:2298:7)

IE version is 11.0.9600.16438

Activity

  1. jamie-pate commented on Dec 3, 2013

    @jamie-pate

    Also happens in ie10, attempting to access nodeValue on a parentless TextNode (nodeType=3)

    // in function addTextInterpolateDirective()
    node[0].nodeValue = value
    
  2. jamie-pate commented on Dec 4, 2013

    @jamie-pate

    May be related to #2614 ??

  3. jamie-pate commented on Dec 18, 2013

    @jamie-pate

    I still prefer capability sniffing over user agent sniffing..... See my post on #2614

  4. aschiebler commented on Dec 18, 2013

    @aschiebler

    Sounds great, but which capability could be tested in this case? Ie....ugh

  5. jamie-pate commented on Dec 18, 2013

    @jamie-pate

    The capability to not raise an event when the placeholder changes (like the
    snippet I posted in the other issue (I think it still applies))
    On 17 Dec 2013 21:24, "Ender2050" [email protected] wrote:

    Sounds great, but which capability could be tested in this case? Ie....ugh

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/5025#issuecomment-30818022
    .

  6. ghost assigned on Dec 31, 2013
  7. seckardt commented on Mar 28, 2014

    @seckardt

    As the docs suggest: Easiest way to address such issues is to switch from using placeholder="{{value}}" to ng-attr-placeholder="{{value}}".

  8. provegard commented on Mar 28, 2014

    @provegard
    ContributorAuthor

    @seckardt Cool, I didn't know about ngAttr. I wrote a custom directive as a workaround, but now I can get rid of it.

    I see it's under Developer Guide / Directives in the docs, but not in the API reference. Wouldn't it be a good idea to have it there too?

  9. tomasaschan commented on Nov 11, 2015

    @tomasaschan

    This isn't just placeholder binding that throws this error, though. This failed with the same behavior:

    <textarea ng-model="foo">{{ foo }}</textarea>
    

    The interpolation is redundant, so the workaround in this case was just to remove {{ foo }}, but it's kind-of annoying that the error message for this is so useless. I spent several hours troubleshooting this before finding the issue.

  10. RafaelSalguero commented on Feb 10, 2016

    @RafaelSalguero

    This error happens also when setting the style style="padding: 3px; background: {{l.Color}}; opacity: 0.7; border-radius: 5px"

    How can I substitute this expression in a way that it works with IE?

  11. gkalpak commented on Feb 10, 2016

    @gkalpak
    Member

    This is a known issue with IE. As mentioned above, you can use ng-attr-style="...".

  12. 2 remaining items

  13. gkalpak commented on Jul 29, 2016

    @gkalpak
    Member

    This bug report seems relevant. It seems that the placeholder value would stick around as <textarea>'s content. They have fixed that (at least in latest IE11), but not 100%; i.e. the placeholder text does appear as content, albeit only temporarily.

  14. added a commit that references this issue on Jul 29, 2016
    6b6ba6a
  15. added a commit that references this issue on Jul 31, 2016
    f9e7dab
  16. LotusShiv commented on Sep 10, 2016

    @LotusShiv

    In my case, I dont even have a placeholder. I just have something similar to this <textarea ng-model='$parent.freetext.text' >{{dataobject.text}}</textarea> and I still get the interpolation error. Any thoughts/solution is greatly appreciated. FYI, I am using 1.5 version of angularjs...

  17. gkalpak commented on Sep 10, 2016

    @gkalpak
    Member

    @LotusShiv, don't put any value in your text area. If you want to initialize it, put the value on the model instead.

  18. LotusShiv commented on Sep 11, 2016

    @LotusShiv

    So gkalpak - in my case I need to bind to the existing value from a WebAPI call and also allow user to edit the text area. Hence I had the ng-model and textarea value setting. Now the way I understood from your response is that - I have to set the value coming from the WebAPI call to a $scope object variable and use the same $scope object variable for setting the edited contents as well. Am I understanding you correctly? Again thanks in advance for any suggestions/solution. Sample code is appreciated too....

  19. LotusShiv commented on Sep 11, 2016

    @LotusShiv

    Addendum to my previous comment, I did exactly as I explained of what I understood from gkalpak 's suggestion and it worked. Thanks gkalpak, works just fine in IE 11. Saved a lot of heartache.... :) after days of trying so many other tips and tricks ....

  20. Lelli commented on Nov 3, 2016

    @Lelli

    As many of the people above have mentioned this error is in fact a usage error, in my case it was not in a textarea but the comments above really helped. Thanks everyone :)
    Will put my specific problem and fix below for others that might be in the same situation.

    Not working;
    <a concat="[result.responsible.Contact.firstName, result.responsible.Contact.lastName]">{{responsibleFullName}}</a>
    Working;
    <a>{{result.responsible.Contact.firstName}} {{result.responsible.Contact.lastName}}</a>

  21. Pirozek commented on Oct 16, 2017

    @Pirozek

    Also encountered this problem, for me it was template attr in directive. When you use just template: '{{field}}' you will get this error. For me I was replacing element HTML with compiled content, so the solution was to remove {{field}}and leave it just with template: '', but this is strange bug and debugging it in IE is pain :(

  22. rsheptolut commented on Dec 25, 2017

    @rsheptolut

    Same thing with the rows binding for the textarea, and yes, IE wasn't giving me ANY clues until I've had to turn on the "break on every exception" mode and stepped through a billion of first-chance exceptions. Angular debug info in the exception also only pointed me to the component, but not to what's wrong with it. Anyway, fixed by changing the binding from [rows]="myRowsField" to [attr.rows]="myRowsField"

  23. alex123bob commented on Feb 19, 2018

    @alex123bob

    @seckardt you make my day. One of my very old project is still based on Angular1, struggling to find solution to this problem. Thanks a lot.

  24. eluchsinger commented on May 11, 2018

    @eluchsinger

    Even if there is an "easy workaround", it would be a lot easier, if the error message would be a bit more helpful. I have a huge project and somewhere there is this double interpolation. How am I supposed to find this?

  25. added a commit that references this issue on Sep 28, 2024
    4ef2169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions