ICRF breaks camera pan and tilt


I implemented code to toggle into ICRF camera view per the documentation (Transforms - Cesium Documentation).

However, when I enter into ICRF, I am unable to pan or tilt. When I exit ICRF, pan functionality returns, but tilt functionality seems to be permanently disabled.

Here is my code. Any help would be appreciated. Thank you.

<!DOCTYPE html>
<html lang="en">

    <meta charset="utf-8">
    <script src="https://cesium.com/downloads/cesiumjs/releases/1.113/Build/Cesium/Cesium.js"></script>
    <link href="https://cesium.com/downloads/cesiumjs/releases/1.113/Build/Cesium/Widgets/widgets.css" rel="stylesheet">

    <button type="button" onclick="toggleEcef()">Toggle Reference Frame</button><br>Current Reference Frame:<span
    <div id="cesiumContainer" style="height: 600px; width:800px"></div>
<script type="application/javascript">

    function toggleEcef() {
        ecef = !ecef;
        let span = document.getElementById("mode");
        span.innerHTML = ecef ? "ECEF" : "ICRF";

    var ecef = true;
    function updateCameraInertial(scene, time) {
        if (!ecef) {
            const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
            if (Cesium.defined(icrfToFixed)) {
                const camera = viewer.camera;
                const offset = Cesium.Cartesian3.clone(camera.position);
                const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
                camera.lookAtTransform(transform, offset);
            } else {
                console.error("icrToFixed not defined")


    const viewer = new Cesium.Viewer('cesiumContainer', {
        terrain: Cesium.Terrain.fromWorldTerrain(),




Just wanted to bump this topic. Would really appreciate any ideas/thoughts. Thanks in advance.