text-fields
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -132,8 +132,19 @@ | ||
}, | ||
reset () { | ||
const fields = [ | ||
...document.querySelectorAll(".text-field-container input, .text-field-container textarea") | ||
]; | ||
const resetFields = ()=>{ | ||
fields.forEach((field)=>{ | ||
const e = field; | ||
e.parentNode.classList.remove("textarea--filled", "textarea--error"); | ||
e.parentNode.classList.remove("input--filled", "input--error"); | ||
e.value = ""; | ||
}); | ||
}; | ||
requestAnimationFrame(resetFields); | ||
}, | ||
init () { | ||
this.notched(); | ||
this.handlers(); | ||
}, | ||
destroy () { | ||
this.notches = []; | ||
} | ||
@@ -140,0 +151,0 @@ }; |
@@ -120,8 +120,19 @@ function $b6e9082d8b811de5$var$notched() { | ||
}, | ||
reset () { | ||
const fields = [ | ||
...document.querySelectorAll(".text-field-container input, .text-field-container textarea") | ||
]; | ||
const resetFields = ()=>{ | ||
fields.forEach((field)=>{ | ||
const e = field; | ||
e.parentNode.classList.remove("textarea--filled", "textarea--error"); | ||
e.parentNode.classList.remove("input--filled", "input--error"); | ||
e.value = ""; | ||
}); | ||
}; | ||
requestAnimationFrame(resetFields); | ||
}, | ||
init () { | ||
this.notched(); | ||
this.handlers(); | ||
}, | ||
destroy () { | ||
this.notches = []; | ||
} | ||
@@ -128,0 +139,0 @@ }; |
{ | ||
"name": "text-fields", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "Input, textarea, material", | ||
@@ -5,0 +5,0 @@ "author": "ux-ui.pro", |
@@ -44,5 +44,2 @@ <br> | ||
``` | ||
```javascript | ||
TextFields.destroy(); | ||
``` | ||
<br> | ||
@@ -49,0 +46,0 @@ |
@@ -26,2 +26,18 @@ import notched from './module/notched'; | ||
reset() { | ||
const fields = [...document.querySelectorAll('.text-field-container input, .text-field-container textarea')]; | ||
const resetFields = () => { | ||
fields.forEach((field) => { | ||
const e = field; | ||
e.parentNode.classList.remove('textarea--filled', 'textarea--error'); | ||
e.parentNode.classList.remove('input--filled', 'input--error'); | ||
e.value = ''; | ||
}); | ||
}; | ||
requestAnimationFrame(resetFields); | ||
}, | ||
init() { | ||
@@ -31,8 +47,4 @@ this.notched(); | ||
}, | ||
destroy() { | ||
this.notches = []; | ||
}, | ||
}; | ||
export default TextFields; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84896
424
49