Skip to content

Commit d666293

Browse files
Merge pull request #20934 from Snuffleupagus/fix-TextLayerBuilder-abortSignal
Ensure that `TextLayerBuilder` works correctly without the `abortSignal` parameter (PR 20928 follow-up)
2 parents b6c9b12 + ba796a3 commit d666293

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

web/text_layer_builder.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,14 @@ class TextLayerBuilder {
169169
#bindMouse(end) {
170170
const { div } = this;
171171
const abortSignal = this.#abortSignal;
172+
const opts = abortSignal ? { signal: abortSignal } : null;
172173

173174
div.addEventListener(
174175
"mousedown",
175176
() => {
176177
div.classList.add("selecting");
177178
},
178-
{ signal: abortSignal }
179+
opts
179180
);
180181

181182
div.addEventListener(
@@ -190,7 +191,7 @@ class TextLayerBuilder {
190191
}
191192
stopEvent(event);
192193
},
193-
{ signal: abortSignal }
194+
opts
194195
);
195196

196197
TextLayerBuilder.#textLayers.set(div, end);

0 commit comments

Comments
 (0)