Skip to content

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

Merged
mshibuya merged 2 commits into
railsadminteam:masterfrom
HashNotAdam:hotfix/fix_duplication_bug
Sep 3, 2016
Merged

Issue #2677: Autocomplete fields duplicated when using browser back/forward buttons#2678
mshibuya merged 2 commits into
railsadminteam:masterfrom
HashNotAdam:hotfix/fix_duplication_bug

Conversation

@HashNotAdam
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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