semantic-forms 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/semanticForms.js +4 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "semantic-forms",
3
3
  "description": "Semantic Forms",
4
4
  "author": "Eric Newport <kethinov@gmail.com>",
5
- "version": "3.0.2",
5
+ "version": "3.0.3",
6
6
  "files": [
7
7
  "semanticForms.css",
8
8
  "semanticForms.js",
package/semanticForms.js CHANGED
@@ -50,9 +50,9 @@ window.semanticForms = function () {
50
50
  dl.classList.add('floatLabelForm')
51
51
  }
52
52
  if (input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')) {
53
- label = document.querySelector('label[data-for=' + input.parentNode.parentNode.id + ']')
53
+ label = document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\./g, '\\.') + ']')
54
54
  } else {
55
- label = document.querySelector('label[for=' + input.id + ']')
55
+ label = document.querySelector('label[for=' + input.id.replace(/\./g, '\\.') + ']')
56
56
  }
57
57
  labelHTML = label.innerHTML
58
58
  if (type === 'checkbox' || type === 'radio') {
@@ -126,6 +126,8 @@ window.semanticForms = function () {
126
126
  clearfieldHorizontalOffset + clearfieldVerticalOffset > e.clientY - el.getBoundingClientRect().top
127
127
  ) {
128
128
  el.value = ''
129
+ el.dispatchEvent(new Event('input'))
130
+ el.form.dispatchEvent(new Event('input'))
129
131
  el.classList.remove('x')
130
132
  el.classList.remove('onX')
131
133
  }