I really like the behavior of the phx-disable-with attribute for providing feedback to the user when something happens, but i find that for users on a fast connection, it can be a little jarring to have the button text change so rapidly. This is especially the case when editing something in place and the form doesn’t do a redirect.
Would there be interest in adding a phx-disable-with-delay type attribute, which would only change the text content after X number of milliseconds?
I’d be happy to attempt a PR, but I didn’t want to go through the work if there was no interest.
Those attributes are a little bit different - as those add delay to the time that the change events are triggered and sent over the socket.
My proposed attribute would purely be cosmetic - it wouldn’t change the timing of when the event is sent over the socket, it would only add a delay to when the textContent of the button changes.
My suggestion is similar to the change to the topbar to add a minimum delay before it displays.