import { onLoad } from './util';

onLoad(() => {
  // This is a patch to remove duplicated dropdown selections.
  // It would be better to prevent these from being created.
  setTimeout(() => {
    $('.dropdown.bootstrap-select > .dropdown.bootstrap-select').each(function () {
      const useSelect = $(this);
      useSelect.parent().replaceWith(useSelect);
    });
  }, 10);
});


import { onLoad } from './util';

setTimeout(() => {
  /* This is a patch to remove duplicated bootstrap-select dropdown selections.
   * It would be better to prevent these from being created.
   * This is added to onLoad() from a setTimeout, so it ends up being called
   * after other functions. Putting the operation within a setTimeout that's
   * called on each load results in the duplicate being visible briefly.
   */
  onLoad(() => {
    $('.dropdown.bootstrap-select > .dropdown.bootstrap-select').each(function () {
      const useSelect = $(this);
      useSelect.parent().replaceWith(useSelect);
    });
  });
}, 100);

Add the dup bootstrap-select removal to onLoad() after others.
Add the dup bootstrap-select removal to onLoad() after others.
