Skip to content

Commit

Permalink
Fix form loading state on back navigation.
Browse files Browse the repository at this point in the history
  • Loading branch information
liffiton committed Jul 19, 2024
1 parent a3482f3 commit afc458a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/codehelp/templates/help_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div class="container">
{# debounce on the submit handler so that the form's actual submit fires *before* the form elements are disabled #}
<form class="wide-labels" action="{{url_for('helper.help_request')}}" method="post" x-data="{loading: false}" x-on:submit.debounce.10ms="loading = true">
<form class="wide-labels" action="{{url_for('helper.help_request')}}" method="post" x-data="{loading: false}" x-on:pageshow.window="loading = false" x-on:submit.debounce.10ms="loading = true">

{% if auth['class_name'] %}
<div class="field is-horizontal">
Expand Down
2 changes: 1 addition & 1 deletion src/codehelp/templates/tutor_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="title">{{topic}}</h1>
{% endif %}

{# debounce on the submit handler so that the form's actual submit fires *before* the form elements are disabled #}
<form action="{{url_for('tutor.new_message')}}" method="post" x-data="{loading: false}" x-on:submit.debounce.10ms="loading = true">
<form action="{{url_for('tutor.new_message')}}" method="post" x-data="{loading: false}" x-on:pageshow.window="loading = false" x-on:submit.debounce.10ms="loading = true">
<input type="hidden" name="id" value="{{chat_id}}">

{{ chat_component(chat, msg_input=True) }}
Expand Down
2 changes: 1 addition & 1 deletion src/starburst/templates/help_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1 class="title">Generate Ideas</h1>
</div>

{# debounce on the submit handler so that the form's actual submit fires *before* the form elements are disabled #}
<form class="wide-labels" action="{{url_for('helper.help_request')}}" method="post" x-data="{loading: false}" x-on:submit.debounce.10ms="loading = true">
<form class="wide-labels" action="{{url_for('helper.help_request')}}" method="post" x-data="{loading: false}" x-on:pageshow.window="loading = false" x-on:submit.debounce.10ms="loading = true">

<div class="field is-horizontal">
<div class="field-label is-normal">
Expand Down

0 comments on commit afc458a

Please sign in to comment.