question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clear filter set empty string against clear array

See original GitHub issue
  1. Create element
<select name="types[]" multiple="multiple"></select>
  1. Initialize
allowClear: true,
  1. delete all selected items and you get array with empty sting.

Proof: image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mhabsaouicommented, Apr 27, 2021

To be fully complete :

    • What steps can be used to reproduce the issue?
      

as explained on previous post

    • What is the bug and what is the expected outcome?
      

bug is the empty button appearing at start of the selected items as explained on previous post. Expected to Not have it.

    • What browser(s) and Operating System have you tested with?
      

Latest Firefox, Chrome and Safari on Latest Ubuntu (18.04.5 / 20.04.1 LTS), Windows (10) and MacOS (Catalina, BigSur)

    • Does the bug happen consistently across all tested browsers?
      

Yes, fully reproducible !

    • Can you reproduce this issue on any of the examples in the docs?
      

Don’t know if it can be applied to those examples, but have to try…

    • What version of jQuery are you using? And what version of Select2?
      

“select2”: “4.0.6-rc.0”, “jquery”: “3.3.1”, => We kept an aloder version of jquery because of the annoying auto focusing not working on latest jquery version…

    • Are you using Select2 with other plugins?
      

Nope. select2+jquery are the main used.

Hope it helps 😃

0reactions
stale[bot]commented, Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove empty elements from an array in Javascript
1. BEWARE: filter(String) and filter(Object) do not filter out null or numbers. · 1. Nice answer, although I wonder about the performance overhead...
Read more >
How to Remove Empty Strings From an Array in JavaScript
To remove empty strings from an array in JavaScript, call the filter() method on the array, passing a callback that returns true for...
Read more >
Remove Empty Strings from an Array in JavaScript | bobbyhadz
To remove all empty strings from an array, use the `Array.filter()` method to iterate over the array. Check if each element is not...
Read more >
How to Remove Empty Strings From an Array ... - Coding Beauty
To remove empty strings from an array in JavaScript, call the filter() method on the array, passing a callback that returns true for...
Read more >
How to Remove Empty Elements from an ... - Tutorial Republic
You can simply use the filter() method to remove empty elements (or falsy values) from a JavaScript array. A falsy value is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found