Skip to content

Commit

Permalink
fix(textareafield): visual glitches
Browse files Browse the repository at this point in the history
if a textarea is visibles after scrollong and under a condition,
triggering on and off teh conditin may lead to a partially visible areal (only the toolbar)

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 5, 2020
1 parent 9366773 commit 91364c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,9 @@ function formcreatorShowFields(form) {
var sectionId = parseInt(sectionKey);
if (!isNaN(sectionId)) {
if (sectionToShow[sectionId]) {
$('div[data-section-id="' + sectionId+ '"]').show();
$('div[data-section-id="' + sectionId+ '"]').css('visibility', '');
} else {
$('div[data-section-id="' + sectionId+ '"]').hide();
$('div[data-section-id="' + sectionId+ '"]').css('visibility', 'hidden');
}
}
}
Expand All @@ -647,12 +647,14 @@ function formcreatorShowFields(form) {
questionId = parseInt(questionKey.replace('formcreator_field_', ''));
if (!isNaN(questionId)) {
if (questionToShow[questionKey]) {
$('#form-group-field-' + questionKey).show();
$('#form-group-field-' + questionKey).css('visibility', '');
$('#form-group-field-' + questionKey).css('height', '');
i++;
$('#form-group-field-' + questionKey).removeClass('line' + (i+1) % 2);
$('#form-group-field-' + questionKey).addClass('line' + i%2);
} else {
$('#form-group-field-' + questionKey).hide();
$('#form-group-field-' + questionKey).css('visibility', 'hidden');
$('#form-group-field-' + questionKey).css('height', '0');
$('#form-group-field-' + questionKey).removeClass('line0');
$('#form-group-field-' + questionKey).removeClass('line1');
}
Expand Down

0 comments on commit 91364c2

Please sign in to comment.