Open mattneal-stafflink opened 1 year ago
As above. In other single/multi select fields, hitting enter selects the option. In Nice-Select2, it submits the form. There should be a way to prevent this from happening. For the moment I'm just using my own solution:
NiceSelect.bind( document.getElementById('property_location'), {searchable: true, placeholder: 'Search'} ); const searchForm = document.getElementById('property-search-form'); searchForm.addEventListener('submit', function(e) { if ( searchForm.querySelector('.nice-select-search:focus') ) { e.preventDefault(); document.getElementById("PrimarySubmit").focus(); } });
Which works fine, but I feel like this should be the default...
As above. In other single/multi select fields, hitting enter selects the option. In Nice-Select2, it submits the form. There should be a way to prevent this from happening. For the moment I'm just using my own solution:
Which works fine, but I feel like this should be the default...