Add Test Definition modal scrolls off screen after adding a parameter
Describe the bug
In AI mode, the Add Test Definition modal (Observability → Test Library) breaks scrolling once a parameter is added:
- After clicking Add Parameter, scrolling past the end of the form keeps going and scrolls the whole modal off screen, leaving only the blurred backdrop.
- Clicking a parameter's Required switch makes the modal jump to the bottom and disappear.
To Reproduce
- Switch to AI mode.
- Go to Observability → Test Library → Add Test Definition (viewport 1440×900).
- Click Add Parameter.
- Scroll past the end of the form → the modal scrolls off screen.
- Reload, repeat steps 2–3, then click the parameter's Required switch → the modal jumps to the bottom and disappears.
Expected behavior
The form scrolls to its end and stops. The modal stays in place. Toggling Required does not move the modal.
Root cause
react-aria renders a visually-hidden <input> with position: absolute inside Toggle/Checkbox. The form body has no positioned ancestor, so the input anchors to the modal panel, outside the form's scroll container, at its unscrolled offset. Measured at 1440×900: visible Required switch at y=613, hidden input at y=1807. The modal overlay becomes 1805px tall in a 900px viewport and is scrollable:
- Bug 1: wheel scroll runs past the form end and into the overlay (scrolls 905px).
- Bug 2: clicking the switch focuses the hidden input, so the browser scrolls the overlay 905px to reveal it.
Affects every Toggle/Checkbox in TestDefinitionFormBody (Required switch, Enabled switch in edit mode, multi-select checkboxes), in both the modal and classic drawer variants.
Screen recording
https://github.com/user-attachments/assets/9c2fc1da-8c83-4b76-a896-9163595090f7
Fix
#34897
Please assign this to me.