MOBILE-4362 quiz: Fix Drag&Drop race condition

main
Noel De Martin 2023-10-11 10:26:07 +02:00
parent 781a4da551
commit 0052dfc7f1
1 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreUtils } from '@services/utils/utils';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
import { CoreEventObserver } from '@singletons/events'; import { CoreEventObserver } from '@singletons/events';
import { CoreLogger } from '@singletons/logger'; import { CoreLogger } from '@singletons/logger';
@ -148,7 +147,10 @@ export class AddonQtypeDdImageOrTextQuestion {
} }
} }
await CoreUtils.nextTick(); await CoreDom.waitToBeVisible(
this.container.querySelector<HTMLElement>('.ddarea') ??
this.container,
);
// All drag items have been created, position them. // All drag items have been created, position them.
this.repositionDragsForQuestion(); this.repositionDragsForQuestion();