Skip to content

fix: prevent horizontal scroll jump when opening a promotion parameter dropdown#1102

Open
mvanhorn wants to merge 1 commit into
semaphoreio:mainfrom
mvanhorn:fix/1003-promotion-dropdown-scroll
Open

fix: prevent horizontal scroll jump when opening a promotion parameter dropdown#1102
mvanhorn wants to merge 1 commit into
semaphoreio:mainfrom
mvanhorn:fix/1003-promotion-dropdown-scroll

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 9, 2026

Copy link
Copy Markdown

📝 Description

Opening a promotion parameter dropdown in the workflow view scrolls the page horizontally back to the pipeline's left edge, because the dropdown's focus() call triggers the browser's default scroll-into-view on the whole diagram. This change restores focus without the jump: target_params.js now focuses the select and text inputs with preventScroll: true and preserves the caret position via setSelectionRange instead of relying on the default focus scroll.

Added mocha specs in switch.spec.js that stub HTMLElement.prototype.focus and assert both the select and text parameter inputs are focused with preventScroll: true, and that the caret restore happens through setSelectionRange.

Fixes #1003

✅ Checklist

  • I have tested this change
  • This change requires documentation update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

View is moved to the utmost left when opening a dropdown

1 participant