79129585

Date: 2024-10-26 22:39:02
Score: 0.5
Natty:
Report link

End of 2024, appartently the only solution that worked for me to prograatically clear Select2 (version 4.0.13) options without interfering with other events was the one hidden down in the Select2 documentation for clear select options

I used $('#mySelect2').val(null).trigger('change');

Reasons:
  • Whitelisted phrase (-1): worked for me
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Rodrigo