Skip to content

Stop Escape propagation in settings list edit widgets - #297605

Merged
Benjamin Pasero (bpasero) merged 2 commits into
mainfrom
copilot/fix-modal-settings-dialog
Feb 25, 2026
Merged

Benjamin Pasero (bpasero) merged 2 commits into
mainfrom
copilot/fix-modal-settings-dialog

Conversation

Copilot AI commented Feb 25, 2026 •

Copy link
Copy Markdown
Contributor

In the modal settings dialog, pressing Escape while editing a new list item (e.g. less.lint.validProperties → Add Item) closes the entire dialog instead of just canceling the edit.

The Escape handlers in ListSettingWidget and ObjectSettingDropdownWidget call e.preventDefault() but not e.stopPropagation(), so the event bubbles up to the modal container's Escape listener which closes the dialog.

  • Added e.stopPropagation() alongside existing e.preventDefault() in both renderEdit and renderStringEditWidget Escape handlers in settingsWidgets.ts
Original prompt

This section details on the original issue you should resolve

<issue_title>Modal settings dialog: Escape should not close dialog when focus is in new item</issue_title>
<issue_description>Testing #296337

  • open the settings editor
  • enter less.lint.validProperties in the settings search bar
  • click on Add Item, focus is in the new item
  • press escape as I don't want to add a new item anymore
  • settings dialog close
  • I have to open it again and enter less.lint.validProperties`</issue_description>

Comments on the Issue (you are Copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…l dialog from closing

When editing a list item in the settings editor (e.g., Add Item for
less.lint.validProperties), pressing Escape should cancel the edit
operation, not close the entire modal settings dialog.

The Escape key handlers in ListSettingWidget and
ObjectSettingDropdownWidget were calling preventDefault() but not
stopPropagation(), allowing the event to bubble up to the modal
container's Escape handler which closed the dialog.

Fixes #296337

Co-authored-by: bpasero <[email protected]>
Copilot AI changed the title [WIP] Fix escape key behavior in modal settings dialog Stop Escape propagation in settings list edit widgets Feb 25, 2026
@bpasero
Benjamin Pasero (bpasero) marked this pull request as ready for review February 25, 2026 06:57
Copilot AI review requested due to automatic review settings February 25, 2026 06:57
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Raymond Zhao (@rzhao271)

Matched files:

  • src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where pressing Escape while editing a new item in a settings list (e.g., adding a value to less.lint.validProperties) closes the entire modal settings dialog instead of just canceling the edit operation.

Changes:

  • Added e.stopPropagation() to Escape key handlers in ListSettingWidget and ObjectSettingDropdownWidget to prevent event bubbling to the modal container

@bpasero
Benjamin Pasero (bpasero) merged commit ca22571 into main Feb 25, 2026
23 checks passed
@bpasero
Benjamin Pasero (bpasero) deleted the copilot/fix-modal-settings-dialog branch February 25, 2026 07:17
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modal settings dialog: Escape should not close dialog when focus is in new item

4 participants