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

Issue #2677: Autocomplete fields duplicated when using browser back/forward buttons #2678

Merged

Conversation

HashNotAdam
Copy link

When accessing the add or edit page for a model that uses the ui-autocomplete fields, using the back and forward buttons on the browser can cause the autocomplete fields to be duplicated.

In _create, check if the field exists before creating it but still initialise autocomplete and set any necessary event handlers.

Also break out the Javascript into multiple, much smaller, functions so it is easier to follow. Since the Asset Pipeline can be used for magnification, we can afford to increase file size to increase readability. Who knows, the file may even get tested one day too.

@HashNotAdam
Copy link
Author

CI failing due to Rubocop issues addressed in PR 2679

Adam Rice added 2 commits July 29, 2016 15:52
…owser back/forward buttons

When accessing the add or edit page for a model that uses the ui-autocomplete
fields, using the back and forward buttons on the browser can cause the
autocomplete fields to be duplicated.
Ensure Javascript all conforms to standards.
Remove unnecessary whitespace but add whitespace where it makes long strings
easier to read.
@HashNotAdam HashNotAdam force-pushed the hotfix/fix_duplication_bug branch from 49b9429 to 5da6a54 Compare July 29, 2016 05:52
@mshibuya mshibuya merged commit 77d8421 into railsadminteam:master Sep 3, 2016
@mshibuya
Copy link
Member

mshibuya commented Sep 3, 2016

Works fine, 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

Successfully merging this pull request may close these issues.

2 participants