FilteredSelectMultiple gets cleared when using back button
|Reported by:||olofsj@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In the admin all fields that use a FilteredSelectMultiple will be cleared if the user leaves the page and then returns via the back button in the browser.
The reason seems to be that the FilteredSelectMultiple widget removes all selected items from the original select widget and moves them to another select widget. This confuses the browser about which items were selected.
The attached patch works around this by setting all items that were originally selected by default as selected. Then at least the widget gets back to the state it had on initial page load, though any changes the user may have done before leaving the page will not be kept so there's probably a better way to solve it.