Android tablet modal goes full width when focusing on input within it

I have noticed on Android tablets (at least on the emulator) that when selecting an input within a modal the modal suddenly goes full width. This doesn’t happen on iPad. Is this normal behaviour or is there a way to stop this?
Screenshots below showing before clicking on the input field and after.

I have tested this on a real Android tablet and this issue occurs on here as well. Is there any solution for this?