Zoom to fit: Frame only

Check the shortcut in the Figma menu ⟩ View ⟩ Zoom to fit. Perhaps you still need to enable or disable the “Keyboard zooms into selection” item in Menu ⟩ Preferences.