Dataframe behaviour difference desktop and web

Hi community,

the other day I spotted an (for me) unexpected behaviour on using a standard st.dataframe().
My expected behaviour is that the dataframe would resort once you click on a column’s header.

I observed this on my mobile phone (Android but with several browsers) as well as the dev-device option of Chrome at my desktop.

Anyone else having the same issue. Any workarounds (click events…)?



Hey @JonasP,

Thanks for posting! Can you share the app that was displaying this behavior?

Hi Caroline,

thanks for having a look at it.
I can replicate this at with any streamlit app - also from the official streamlit gallery, such as the “bug-report” app.

For better illustration of the matter you can have a look at this screen recording: Link

Thanks for keeping me updated.


NB: Tables created with streamlit-aggrid are fine.

Thanks for keeping me updated

I just tried the app you linked and could get it to misbehave as you illustrated on Chrome (dev-device Windows 10) and Android, but at the same time if I tried a different app and there was no problem with the dataframe sorting.

Linked Bug Report df doesn’t sort; other app df does sort:

DuckDuckGo 5.144.0 (51440000), Android 13
Chrome 107.0.5304-141, Android 13
Chrome 108.0.5359.95, dev-device view, Windows 10

Linked Bug Report df sorts correctly, as well as other app df

Firefox 107.0.1, on Windows 10 (both regular and dev-device view)
Chrome 108.05359.95, desktop view, Windows 10

For reference, I looked at the dataframe on this page to compare another app:

Do you have some other apps that misbehave since I tried a couple other apps, but only that Bug Report is behaving oddly for me so far.

I checked on the app for reference. I also get the sorting feature on mobile for it.

On my code I tried st.dataframe() as well as st.write() with no effect.
I simplified a test code as much as only having streamlit and pandas imported - same isue.

For your information, my app runs on streamlit version 1.11.0

Can you try upgrading to the latest Streamlit version? If it’s still an issue, feel free to file a bug report as a Github issue, and we’ll get an engineer from our team to look into it!