"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useScrollSnapLoadingFix = void 0;
var scroll_1 = require("../../utils/scroll");
var tiles_1 = require("../../utils/tiles");
exports.useScrollSnapLoadingFix = function (containerRef, selected) {
    var onLoad = function () {
        /* scroll-snapping on chrome jumps to random position in list when images load */
        if (containerRef.current) {
            var tile = tiles_1.getTile(containerRef.current, selected);
            scroll_1.scrollToCenter(containerRef.current, tile, false);
        }
    };
    return { onLoad: onLoad };
};
