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

this.refresh() in onDataChange helper does not refresh the html form fields #105

Open
Kshatra opened this issue Jan 20, 2017 · 1 comment

Comments

@Kshatra
Copy link

Kshatra commented Jan 20, 2017

It seems that this.refresh() in onDataChange helper does not refresh the html form fields, though setting original values to new values.
Seems like the issue is in this part of module.js code:

// Update reactiveValue without tracking it.
return Tracker.nonreactive(function () {

    // If the remote value is different from what's in initial data, set `newRemoteValue`.
    // Otherwise, leave it--the user's edits are still just as valid.
    if (!_.isEqual(component.value.get(), fieldValue)) {
        component.newRemoteValue.set(fieldValue);

        // Allow for remote data changes to pass through without user action.
        // This is important for the experience of some components.
        if (component.passThroughData) {
            component.refresh();
        } else {
            component.remoteValueChange.set(true);
            component.refresh(); //only refreshes if add this line
        }
    }
});

I've managed to get html input refresh by applying component.refresh() also in the else clause of if (component.passThroughData).

@Kshatra Kshatra closed this as completed Jan 20, 2017
@Kshatra Kshatra reopened this Jan 20, 2017
@Kshatra
Copy link
Author

Kshatra commented Jan 20, 2017

The problem is newRemoteValue in Tracker.nonreactive call is set after the onDataChange's refresh call and reactive refresh never happens again after that. That is because Tracker.afterFlush somehow execures before newRemoteValues is set.

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

1 participant