You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(joint-core): keep blank pointerdown compatible, add paper eventSurface
The previous commit made `pointerdown` run the full `guard()` even when the
press hit no cell view. That is a breaking change: `guard()` rejects any target
that is not on the paper's event surface, so HTML rendered into `paper.el` -
a ruler, a gutter, a toolbar - stopped opening a blank interaction. The whole
gesture went with it, because the document-level drag listeners are delegated
from `pointerdown`.
Restore the old answer while keeping a way to opt out. `guard()` is split in two:
- `guardExplicit()` - decisions made about this very event: the right mouse
button, the `guard` option, an `evt.data.guarded` flag.
- `guard()` - unchanged: `guardExplicit()`, then judge the target itself (its
tag name, its view, the event surface).
A press that hit no cell view now consults only `guardExplicit()`. So the press
opens a blank interaction as it always has, and `options.guard` can veto it -
which was impossible before, since `guard()` was not consulted on that path at
all. Behaviour is otherwise bit-exact: `GUARDED_TAG_NAMES` still judges the
target, so a `<select>` in an overlay is not treated differently.
The remaining asymmetry - such content gets `blank:pointerdown` but no
`blank:pointerclick` and no hover - is now addressable rather than baked in. The
new `eventSurface` paper option declares a DOM subtree part of the interaction
surface, and every handler then treats it as a blank area:
new dia.Paper({ eventSurface: '.ruler' })
It takes a CSS selector (matched with `closest`, so it covers any number of
subtrees), an element, an array of elements, or a predicate. `guard` is
consulted first, so single events can still be vetoed within a surface.
Also types `guard`'s `view` parameter as optional - it has always been called
without a view from `pointerclick`, `mouseover` and the other handlers.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments