Closed mvorisek closed 8 months ago
Since the introduction - https://github.com/atk4/ui/blob/90b0fcecdc/src/jsCallback.php#L21 - the JS chain was allowed to be mutated (like $jquery->xxx()) and if so, it was automatically appended to the response.
$jquery->xxx()
But all usages and demos also return the JS chain!
This was a problem, as the returned JS chain was added to the response as well, so the JS chain was evaluated twice!
Now we fix it by longer adding the JS chain to the response, instead, we require the JS chain to be returned it if it was mutated.
repro: https://github.com/atk4/ui/blob/5.0.0/demos/javascript/js.php#L60
before:
after:
Since the introduction - https://github.com/atk4/ui/blob/90b0fcecdc/src/jsCallback.php#L21 - the JS chain was allowed to be mutated (like
$jquery->xxx()
) and if so, it was automatically appended to the response.But all usages and demos also return the JS chain!
This was a problem, as the returned JS chain was added to the response as well, so the JS chain was evaluated twice!
Now we fix it by longer adding the JS chain to the response, instead, we require the JS chain to be returned it if it was mutated.
repro: https://github.com/atk4/ui/blob/5.0.0/demos/javascript/js.php#L60
before:
after: