From 7319fe44b7880901c9e03df8d533e41a9afe8424 Mon Sep 17 00:00:00 2001 From: Nathan Force Date: Fri, 29 Jan 2021 11:22:24 -0500 Subject: [PATCH] do not assume global HTMLSelectElement --- src/select-options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/select-options.js b/src/select-options.js index 1ca6777d..0e417ea7 100644 --- a/src/select-options.js +++ b/src/select-options.js @@ -36,7 +36,7 @@ function selectOptionsBase(newValue, select, values, init) { if (select.disabled || !selectedOptions.length) return - if (select instanceof HTMLSelectElement) { + if (select instanceof select.ownerDocument.defaultView.HTMLSelectElement) { if (select.multiple) { for (const option of selectedOptions) { // events fired for multiple select are weird. Can't use hover...