Black Lives Matter. Please consider donating to Black Girls Code today.

Stack bar chart refreshing error

My stack bar chart has a weird problem.
When I click on one of the category legend, the small square, it grays out, but instead of stacking on the rest of the data, the stacks above would suspend there, not dropping down.
I am using ggplotly for the ggplot bar chart. I thought it was my coding error, but then when I pasted the sample code from, the problem still exists: