Dispatch a 'filled' and 'empty' event against text inputs, selects and textareas whenever the field is filled or emptied.
npm install manhattan-field-filled --save-dev
import * as $ from 'manhattan-essentials'
import {addFilled} from 'manhattan-field-filled'
$.listen(
$.one('.some-input'),
{
'empty': (ev) => {
this.classList.add('empty')
},
'filled': (ev) => {
this.classList.add('filled')
}
}
)
addFilled()