ScrollTo not working with viwportEnter event

I have a number of collapsed boxes that expand when other elements are clicked. I also want the page to scroll to the box when it expands using viewportEnter. My issue is that of all the boxes scrollTo only works on the first one. Any suggestions how to correct this? Here is my code:

This code works:

export function text416_click(event) {
    if ($w("#box34").collapsed) {
        $w("#box34").expand();
    } else {
        $w("#box34").collapse();
    }
}

export function box34_viewportEnter(event, $w) {
    $w("#box34").scrollTo();
}

This code does not:

export function text421_click(event) {
    if ($w("#box35").collapsed) {
        $w("#box35").expand();
    } else {
        $w("#box35").collapse();
    }
}

export function box35_viewportEnter(event, $w) {
    $w("#box35").scrollTo();
}