meteor-editable-text icon indicating copy to clipboard operation
meteor-editable-text copied to clipboard

Maximum call stack size exceeded

Open mjesuele opened this issue 10 years ago • 4 comments

Hi all,

I am attempting to use editable-text to allow users to change the title of a "stream" (chat room). When clicked, the text turns into an input box as expected, but if the text is edited, I get this stack trace upon losing focus (or enter being pressed) and the input field does not revert to plain text. There is no error if the text is not edited, and the input field does revert.

Uncaught RangeError: Maximum call stack size exceeded     ejson.js:455
EJSON.clone                                               ejson.js:455
(anonymous function)                                      ejson.js:494
_.each._.forEach                                     underscore.js:113 

Those last three calls are repeated over and over. What is causing this recursive loop?

For reference, here is the Jade template:

template(name='messagesList')
  #messages
    h1
      +editableText(collection='streams' field='name')
    each messages
      +message

I am using the following versions:

babrahams:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

You can see the issue for yourself by going to my beta app, creating an account, creating a stream (using the text field on the left panel), and then clicking on the title 'New stream'.

Please let me know if there's any other helpful information I can provide.

mjesuele avatar Feb 13 '15 20:02 mjesuele

Yes, there's definitely something going wrong with the editable text package. It looks like the click event is being fired in some kind of infinite loop, but I can't see how that would be happening without looking at the larger code context.

Any chance you could put up a minimal repro somewhere? I just put together a little test app (below) and it's working as expected:

JADE

head
  title test

body
  +doc

template(name='doc')
  with doc
    h1
      +editableText(collection='documents' field='title')

JS

Documents = new Mongo.Collection('documents');

if (Meteor.isClient) {

  Template.doc.helpers({
    doc: function () {
      return Documents.findOne();
    }
  });

}

if (Meteor.isServer) {

  Meteor.startup(function () {
    Documents.insert({title:"Test title"});
  });

}

JackAdams avatar Feb 14 '15 01:02 JackAdams

Why is this closed? I have the same issue, seems to be still unsolved

mklueh avatar Jul 08 '17 12:07 mklueh

Is it jade or blaze that this is happening for @Mklueh ?

JackAdams avatar Jul 08 '17 12:07 JackAdams

It is Blaze

mklueh avatar Aug 03 '17 18:08 mklueh