I'm using Bootstrap 4 with Rails 6. Everything looks great until I use a dropdown to trigger a search. When the results are returned, all the controls on the page are duplicated, like the dropdown below:
When I refresh the result page, the duplicates disappear:
I'm sure there must be a simple way to prevent this, but I'm entirely unfamiliar with WebPacker, so I've been unable to figure out a solution.
I'm using HAML, and the code to create the dropdown is plain vanilla:
%label Institution =select_tag "institution", options_for_select(@institutions, params[:institution]), include_blank: true
I'm not sure where to even look to try to find where the issue might be. It seems like the bootstrap js code is being called in a loop, with one iteration per page load.
Does this look familiar to anyone?