relayoutData bug when clicking BoxSelect

I am using a mapbox to show points on a map. I want to select an area using Box Select, but when I click the menu button for Box Select, it immediately resets the button so that the functionality is not available to use. If I click it a second time it then remains highlighted and I can finally use Box Select.

What I have noticed is that when relayoutData is included as an input to the callback to update the map, it causes this strange behavior.

If relayoutData is not included as an input to the callback, there is no problem selecting the Box Select button. I only need to click it one time. This seems like a bug.

Does anyone have ideas on how to resolve this?