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

Additional stacked inlines clear un-saved autocomplete fields #156

Closed
mlewis-sandow opened this issue Jan 28, 2016 · 2 comments
Closed

Additional stacked inlines clear un-saved autocomplete fields #156

mlewis-sandow opened this issue Jan 28, 2016 · 2 comments

Comments

@mlewis-sandow
Copy link

I have an admin form that has stacked inlines containing autocomplete select fields. Adding an additional row triggers init-autocomplete. If someone fills out the autocomplete field then adds a row without saving then init-autocomplete gets triggered for the un-saved autocomplete select field and clears it.

Has anyone dealt with this? I tried changing:

$('input[data-ajax-select=autocompleteselect]').each(function (i, inp) {
  addAutoComplete(inp, function ($inp, opts) {
    $inp.autocompleteselect(opts);
  });
});

to:

$('input[data-ajax-select=autocompleteselect][value=""]').each(function (i, inp) {
  addAutoComplete(inp, function ($inp, opts) {
    $inp.autocompleteselect(opts);
  });
});

so that only empty fields are initialized but then of course you cannot change the field after saving.

@crucialfelix
Copy link
Owner

which version are you using ? this bug was fixed in the last release.

@mlewis-sandow
Copy link
Author

Ah, of course that did it. I got a little mixed up because I had forked. Thanks!

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

2 participants