Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to remove selected item we should click on it twice in a row (choices with Adjax-history in drupal) #1139

Open
KateKarpenko opened this issue Dec 6, 2023 · 0 comments
Labels

Comments

@KateKarpenko
Copy link

KateKarpenko commented Dec 6, 2023

Hello community!
I'm wondering if anyone also experiences the issue of using choices.js with turned-on Adjax-history on Drupal view?
I encountered the problem that once after selecting a value in the exposed filter (on which is applied choices.js) to remove that item from the filter I had to click twice in a row. Usual one click somehow doesn't reload a page and this item is still visible as selected (but in URL I can confirm it removes the value of this item).

As I figured it out, if I turn off Adjax-history and keep only Ajax - then everything works as expected. But I don't want to sacrifice of ajax-history. Let me know please any ideas/thoughts. Thanks!

I use choices on a select element (tried both single and multiple selections) in Drupal10

const filterSubject = context.querySelector('select[name="test_filter[]"]');

    new Choices(filterSubject, {
      renderChoiceLimit: -1,
      removeItemButton: true,
      allowHTML: false,
      placeholderValue: "Subject",
    });

Expected behaviour
One click should remove the selected item from the filter immediately and Ajax should update a page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant