Fix select disable not working for svg (#1523)

- fixed svg elements not preventing start if selectDisable is set on parent
This commit is contained in:
brendanlaschke 2023-09-10 20:41:51 +02:00 committed by GitHub
parent fb737e2021
commit c3f5566fde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ export function DragSelect({
if (!isDragSelectionStartEnabled()) {
return false;
}
if (target instanceof HTMLElement) {
if (target instanceof HTMLElement || target instanceof SVGElement) {
let el = target;
while (el.parentElement && !el.dataset.selectDisable) {
el = el.parentElement;