From 0052dfc7f1828face316f3014a0bac618851c282 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 11 Oct 2023 10:26:07 +0200 Subject: [PATCH] MOBILE-4362 quiz: Fix Drag&Drop race condition --- src/addons/qtype/ddimageortext/classes/ddimageortext.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/addons/qtype/ddimageortext/classes/ddimageortext.ts b/src/addons/qtype/ddimageortext/classes/ddimageortext.ts index d02de988e..35ba19b53 100644 --- a/src/addons/qtype/ddimageortext/classes/ddimageortext.ts +++ b/src/addons/qtype/ddimageortext/classes/ddimageortext.ts @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreUtils } from '@services/utils/utils'; import { CoreDom } from '@singletons/dom'; import { CoreEventObserver } from '@singletons/events'; import { CoreLogger } from '@singletons/logger'; @@ -148,7 +147,10 @@ export class AddonQtypeDdImageOrTextQuestion { } } - await CoreUtils.nextTick(); + await CoreDom.waitToBeVisible( + this.container.querySelector('.ddarea') ?? + this.container, + ); // All drag items have been created, position them. this.repositionDragsForQuestion();