Skip to content

Error when adding second filter in FilterBuilder (null querySelector in Layout.svelte) #58

Description

@BraginaT

Hello! We’re trying to implement this sample: [(https://docs.svar.dev/svelte/grid/samples/#/filterbuilder/willow)]

Filtering works for the first column, but when I click Add filter and select another column (any column except the first), I get this error:

Layout.svelte:383 Uncaught TypeError: Cannot read properties of null (reading 'querySelector')
at Layout.svelte:383:10 (line: input.querySelector("input").focus();)

$effect(() => {
  if (_field && input) {
    setTimeout(() => {
      input.querySelector("input").focus();
    }, 1);
  }
});

We have a patch that fixes the issue — could you please take a look? Thank you!

function down(e) {
+  if (e.target?.closest?.('.wx-dropdown')) return;
   oncancel && oncancel(e);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions