Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

fixed: OC: The query view is truncated when viewing query from query table #519

Merged
merged 1 commit into from
Nov 5, 2021
Merged
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
8 changes: 6 additions & 2 deletions widget/discrepancy-note/dn-widget.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Widget from 'enketo-core/src/js/widget';
import { getSiblingElements } from 'enketo-core/src/js/dom-utils';
import { getSiblingElements, MutationsTracker } from 'enketo-core/src/js/dom-utils';
import $ from 'jquery';
import { t } from '../../public/js/src/module/translator';
import settings from '../../public/js/src/module/settings';
Expand Down Expand Up @@ -623,7 +623,11 @@ class Comment extends Widget {
if ( window.innerHeight - this.linkedQuestion.offsetHeight < queryModal.offsetHeight ) {
queryModal.scrollIntoView( option );
} else {
this.linkedQuestion.scrollIntoView( option );
// https://github.com/OpenClinica/enketo-express-oc/issues/518
new MutationsTracker( this.element.closest( 'form' ) ).waitForQuietness()
.then( () => {
this.linkedQuestion.scrollIntoView( option );
} );
}
}

Expand Down