Skip to content

Allow ordinary tab presses to reach ancestor event listeners - #859

Open
obaseyi2 wants to merge 1 commit into
jupyterlab:mainfrom
obaseyi2:fix/tab-pointerdown-propagation
Open

obaseyi2 wants to merge 1 commit into
jupyterlab:mainfrom
obaseyi2:fix/tab-pointerdown-propagation

Conversation

@obaseyi2

@obaseyi2 obaseyi2 commented Oct 25, 2026 •

Copy link
Copy Markdown

Fixes #762.

Ordinary tab presses suppress pointer propagation and compatibility mouse events, so ancestor listeners cannot dismiss an outside-click popup.

Allow ordinary pointer presses/releases to propagate and prevent mouse focus changes on mousedown. Preserve touch compatibility-event cancellation and active-drag release suppression. Changes are in tabbar.ts and its tests.

Reproduction

  1. Attach a TabBar beside a focused input and an open popup.
  2. Register an ancestor mousedown listener that hides the popup.
  3. Click a tab using a real mouse event.

Before: the listener does not dismiss the popup. After: it dismisses the popup while the input retains focus. Ancestors receive pointerdown, mousedown, pointerup, mouseup and click.

Validation

  • Widget suite: 980 tests passed in each of Chromium and Firefox.
  • Original source failed two new regressions; the patch passed them.
  • Separate native-click checks in both browsers verified event delivery, popup dismissal and retained input focus.
  • Source build, changed-file lint/format checks and diff whitespace checks passed.

WebKit and full JupyterLab were not tested. Cancelling pointerdown suppresses compatibility mousedown; moving focus prevention to mousedown is necessary for mouse-based outside-click listeners.

@krassowski krassowski added the bug Something isn't working label Oct 25, 2026

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking on tab stops click event propagation

2 participants