Front-end error when removing options from st.multiselect for certain dataframe shapes

Hi, I have an st.multiselect with default options used to count a dataset by group and display the summary. When removing options that results in just one row to display (e.g. dataframe shape is (1, x)) I get this front-end error and no error on the terminal.

Front-end error:

TypeError: this.addedRows[(n - this.numRows)] is undefined

Jy/<.getCellContent<@http://localhost:8501/static/js/index.6iaad_Si.js:196:1958
nv/_n<@http://localhost:8501/static/js/index.6iaad_Si.js:172:18840
c0/wt<@http://localhost:8501/static/js/index.6iaad_Si.js:165:58821
yu/</<@http://localhost:8501/static/js/index.6iaad_Si.js:165:6985
xa@http://localhost:8501/static/js/index.6iaad_Si.js:165:1656
yu/<@http://localhost:8501/static/js/index.6iaad_Si.js:165:6658
Lr@http://localhost:8501/static/js/index.6iaad_Si.js:165:1882
yu@http://localhost:8501/static/js/index.6iaad_Si.js:165:6150
Mu@http://localhost:8501/static/js/index.6iaad_Si.js:165:30631
l0/Yt<@http://localhost:8501/static/js/index.6iaad_Si.js:165:41862
l0/<@http://localhost:8501/static/js/index.6iaad_Si.js:165:42211
Cs@http://localhost:8501/static/js/index.C4j9kiPf.js:48:26705
Tu@http://localhost:8501/static/js/index.C4j9kiPf.js:48:34811
wu@http://localhost:8501/static/js/index.C4j9kiPf.js:48:34647
wu@http://localhost:8501/static/js/index.C4j9kiPf.js:48:34538
Ap@http://localhost:8501/static/js/index.C4j9kiPf.js:48:34142
wp@http://localhost:8501/static/js/index.C4j9kiPf.js:48:44968
Ma@http://localhost:8501/static/js/index.C4j9kiPf.js:48:44268
$u@http://localhost:8501/static/js/index.C4j9kiPf.js:48:40575
Yo@http://localhost:8501/static/js/index.C4j9kiPf.js:46:3500
wp@http://localhost:8501/static/js/index.C4j9kiPf.js:48:45380
Ma@http://localhost:8501/static/js/index.C4j9kiPf.js:48:44268
Cu@http://localhost:8501/static/js/index.C4j9kiPf.js:48:39303
Ge@http://localhost:8501/static/js/index.C4j9kiPf.js:33:1885
at@http://localhost:8501/static/js/index.C4j9kiPf.js:33:2290

Code example:

import streamlit as st
import pandas as pd

st.title('Sandbox')

@st.cache_data
def get_data():
    return pd.DataFrame({
        "remove this option": [1, 1, 1, 2, 2, 2, 3, 3, 3],
        "b": ["R", "R", "R", "R", "R", "R", "R", "R", "R"],
        "c": "B"
    })

df = get_data()

col_opts = df.columns
ColOptsFilter = st.multiselect("Select display columns", col_opts, default=df.columns)

if len(ColOptsFilter) == 0:
    st.stop()  # no columns to display, stop executing

tmp = df.groupby(ColOptsFilter).size().reset_index(name='Count')
st.dataframe(tmp)

It is hosted locally on openSuse Leap 15.6, Python 3.11, Streamlit v1.44.0.

What browser?

Firefox 128.10.

I was able to consistently reproduce the issue, but it went away when I upgraded to streamilt 1.45. Maybe related to #10937.