tom-select icon indicating copy to clipboard operation
tom-select copied to clipboard

clear() method empty the visible tom-select field, but set the select field to the default selected option

Open landure opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug

When tom-select is used on a field with '', the clear() method empty the tom-select field, but the <select> field value is set to the default value as set by selected="selected" attribute.

To Reproduce

  1. Go to tom-select.js clear() method empty tom-select.js but set the value to the default field value @ CodePen
  2. Click on Reset
  3. Click on Submit to view field value at submit.

Expected behavior

Tom-Select should have two methods:

  • clear() should empty the field and set the initial select to empty.
  • reset() should set the initial select to its initial value and update the associated tom-select to the initial value, and should be called by the form reset event (see #544 ).

landure avatar Dec 27 '22 13:12 landure

This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Nov 06 '23 02:11 github-actions[bot]

This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Mar 18 '24 01:03 github-actions[bot]