-
Notifications
You must be signed in to change notification settings - Fork 51
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
Edited/updated values getting double-populated on DOM/template after editing. #23
Comments
@evolross I was having the same problem. I ended up implementing a probably wrong but temporary solution that removes the duplication. Do a
|
Your way may be better, as adding |
I tried the Also if this works I think you're doing the same thing I'm doing, which just eliminates x-editable from updating the value and waits on the server/Meteor to update the value... which on a slow server could make for a bad UI experience. |
@evolross yeah I also noticed what you are saying. I agree |
I posted a solution to this at http://stackoverflow.com/a/23144211/586086, mainly cause it also causes a sync error between the field value and the editable value. It's also linked from the main README. |
This fixes a "bug" in the x-editable module which was causing the data to show up twice when the content was saved to the database. nate-strauser/meteor-x-editable-bootstrap#23
I am seeing this same behavior, but can confirm that the data-display="false" fixes it. |
@bryankennedy that only fixes some of it. You'll still notice irregularities if you are editing a field while its value changes; check out the SO link I posted above. |
Mizzao do you have a solution that does not use CoffeeScript? I couldn't make it work. The return " "; does not work as the field is not validated. The data-display="false" method has another problem: If the field is empty, then nothing is shown (instead of the placeholder). |
I'm also having this problem, and just ran into the issue @fercook is having. |
This is a hokey work around in Meteor's Spacebars template language. Example I'm working with, where I'm trying to check if the standard_name is Empty. If it is, then set data-display="true" so the Empty field shows up for editing.
|
I've noticed that for an example editable text field, if I edit the value and in the
success
attribute I do a Meteor collection update with thenewValue
the value gets double populated into the Meteor template. For example, if have adocumentTitle
field set to Noodle Recipe and I update its value to Spicy Noodle Reciple after the update the Meteor template will show Spicy Noodle RecipeSpicy Noodle Recipe. I assume this is because x-editable and Meteor are both updating the DOM behind the scenes. x-editable does it after a successful edit and Meteor does it once it sees the value update in Mongo. To fix this I had to adddata-display="false"
to all my x-editable fields to disable x-editable's updating.It might be good if this was built in and/or at least mentioned in the docs.
The text was updated successfully, but these errors were encountered: