- Issue created by @xandeadx
What is the purpose of
$form_state->setRebuild();
in the example code?- First commit to issue fork.
- Status changed to Needs review
9 months ago 10:23am 6 February 2024 - 🇮🇳India rushiraval
It may not be bug. When you refresh or reload page it will build form again. So form state will reinitialize.
- Status changed to Active
9 months ago 11:06am 6 February 2024 - 🇮🇳India rushiraval
@cilefen I think it is not bug. It normal to reinitialize of variable on refresh. So no need for any code. But if @xandeadx needs to retain value then he may store value in session.
- 🇷🇺Russia xandeadx
On F5 button form submitted, not just "refreshed". Browser send previous POST request.
- 🇷🇺Russia xandeadx
If you don't like case with F5, another example — user click button twice, using "back" in browser, and click third time to button.