Merge pull request #20934 from Snuffleupagus/fix-TextLayerBuilder-abortSignal

Ensure that `TextLayerBuilder` works correctly without the `abortSignal` parameter (PR 20928 follow-up)
This commit is contained in:
Tim van der Meij 2026-03-21 13:48:02 +01:00 committed by GitHub
commit d66629376e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -169,13 +169,14 @@ class TextLayerBuilder {
#bindMouse(end) {
const { div } = this;
const abortSignal = this.#abortSignal;
const opts = abortSignal ? { signal: abortSignal } : null;
div.addEventListener(
"mousedown",
() => {
div.classList.add("selecting");
},
{ signal: abortSignal }
opts
);
div.addEventListener(
@ -190,7 +191,7 @@ class TextLayerBuilder {
}
stopEvent(event);
},
{ signal: abortSignal }
opts
);
TextLayerBuilder.#textLayers.set(div, end);