Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/javascript/controllers/form_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default class extends Controller {

async disableSubmitWhenInvalid(event) {
await nextFrame()
await nextFrame()
Comment on lines 77 to +79

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git message attached to this line is sufficient explaination of why it was needed, no need to bloat the code base with a comment.

Also dont like the nextFame(2) proposal. I'd rather update the nextFrame implementation be a double raf by default, because the requestAnimationFrame fires before the frame, so the next frame should use a double raf, but that would change the behavior in the other 10 spots where the nextFrame() is used, so adding a second one here was a safer change.


if (this.element.checkValidity()) {
this.submitTarget.removeAttribute("disabled")
Expand Down