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

Reactivity in jQuery-generated contenteditable elements (Meteor 0.8.0) #2040

Closed
weiying-chen opened this issue Apr 10, 2014 · 4 comments
Closed

Comments

@weiying-chen
Copy link

I've been having problems with contenteditable elements generated via jQuery since Meteor 0.8.0 (Blaze template engine).

This is my setup (I'm using Medium Editor):

post_page.html:

<template name="postPage">
  <div class="sidebar col-md-4">
    {{#each posts}}
      {{> postItem}}
    {{/each}}
    <a class="save-all" href="javascript:;"><span class="glyphicon glyphicon glyphicon-save"></span></a>
  </div>

  <div class="mainbar col-md-12">
  <form class="form" role="form">
    <div class="form-group">
      <div name="content" class="form-control" id="input-content">{{{content}}}</div>
    </div>
    <button type="submit" class="btn btn-default submit">Submit</button>
  </form>
  </div>
</template>

post_page.js:

Template.postPage.rendered = function() {
  var editor;
  editor = new MediumEditor("#input-content", {
    placeholder: ""
  });
};

post_item.html:

<template name="postItem">
  <div class="post clearfix {{title}}">
    <div class="post-buttons">
      <a class="move-up" href="javascript:;"><span class="glyphicon glyphicon-arrow-up"></span></a>
      <a class="move-down" href="javascript:;"><span class="glyphicon glyphicon-arrow-down"></span></a>
    </div>
    <h2><a class="open-post" href="{{pathFor 'postPage'}}">{{title}}</a></h2>
  </div>
</template>

routes.js:

this.route("postPage", {
  path: "/posts/:_id",
  data: function() {
    return Posts.findOne(this.params._id);
  }
});

Even though I click in an item in the posts list, the {{{content}}} inside the contenteditable div doesn't change (remains the same all the time). For some reason, reactivity is not working in this case.

Any ideas of how to solve this?

@glasser glasser added the Blaze label Apr 10, 2014
@avital
Copy link
Contributor

avital commented Apr 14, 2014

Hi @alexcheninfo.

I'd like to look into this, but in order to do that I need a minimal reproduction as a git repository that we can clone and run. The repository should not use any external packages (including iron-router). If Medium Editor is needed to run it, include it in the repository (not as an Atmosphere package). Ideally, the repro won't require Medium Editor at all.

Thanks in advance.

@avital
Copy link
Contributor

avital commented Apr 14, 2014

@serviewcare
Copy link

Maybe related to my bug: #1964

@avital
Copy link
Contributor

avital commented May 31, 2014

It's been over a month with no repro. Closing.

@avital avital closed this as completed May 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants