Skip to content

Commit 76bf999

Browse files
restore quill text areas
1 parent 9b829d6 commit 76bf999

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/views/components/forms/question_types/_rich_textarea.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%= render 'components/question_title_label', question: question %>
1717
<input
1818
type="hidden"
19-
name="my_model[rich_text]"
19+
name="<%= question.ui_selector %>"
2020
id="<%= question.ui_selector %>">
2121
<div
2222
id="quill-editor-<%= question.ui_selector %>"

app/views/components/widget/_fba.js.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ function FBAform(d, N) {
2727
},
2828
init: function(options) {
2929
this.javascriptIsEnabled();
30-
<%- if form.has_rich_text_questions? %>
31-
this.loadQuill();
32-
<% end %>
3330
this.options = options;
3431
if (this.options.loadCSS) {
3532
this._loadCss();
@@ -38,6 +35,7 @@ function FBAform(d, N) {
3835
if (!this.options.suppressUI && (this.options.deliveryMethod && this.options.deliveryMethod === 'modal')) {
3936
this.loadButton();
4037
}
38+
this.enableLocalStorage();
4139
this._bindEventListeners();
4240
this.successState = false; // initially false
4341
this._pagination();
@@ -47,7 +45,9 @@ function FBAform(d, N) {
4745
<%- if form.enable_turnstile? %>
4846
this.loadTurnstile();
4947
<% end %>
50-
this.enableLocalStorage();
48+
<%- if form.has_rich_text_questions? %>
49+
this.loadQuill();
50+
<% end %>
5151
d.dispatchEvent(new CustomEvent('onTouchpointsFormLoaded', {
5252
detail: {
5353
formComponent: this
@@ -692,6 +692,8 @@ function FBAform(d, N) {
692692
}
693693
});
694694

695+
quill.root.innerHTML = hiddenInput.value; // Restore values
696+
695697
// Sync to hidden field on change
696698
quill.on('text-change', function () {
697699
updateCount();
@@ -702,9 +704,7 @@ function FBAform(d, N) {
702704
const html = quill.root.innerHTML;
703705
countDisplay.textContent = "" + (maxLimit - html.length) + " <%= t :characters_left %>";
704706
};
705-
706707
}
707-
708708
});
709709
},
710710
<% end %>

0 commit comments

Comments
 (0)