src/unbind.js
/**
 * Unbinds eventListener from input field
 * @param  {HTMLElement} element textarea, input
 */
Unbinds eventListener from input field
@param  {HTMLElement} element textarea, input
Unbinds eventListener from input field @param { HTMLElement } element textarea input
function unbind(element, debug = false) {
  const listeners = findListeners(element);
  if (listeners == null) {
    throw new Error(
      `Element provided to Wanakana unbind() had no listener registered.\n Received: ${JSON.stringify(
        element
      )}`
    );
  }
  const { inputHandler, compositionHandler } = listeners;
  element.removeAttribute('data-wanakana-id');
  element.removeAttribute('data-ignore-composition');
  element.removeEventListener('input', inputHandler);
  element.removeEventListener('compositionstart', compositionHandler);
  element.removeEventListener('compositionupdate', compositionHandler);
  element.removeEventListener('compositionend', compositionHandler);
  untrackListeners(listeners);
  if (debug === true) {
    removeDebugListeners(element);
  }
}
function unbind ( element , debug = false ) { const listeners = findListeners ( element ) ; if ( listeners == null ) { throw new Error ( ` \n ${ JSON . stringify ( element ) } ` ) ; } const { inputHandler , compositionHandler } = listeners ; element . removeAttribute ( 'data-wanakana-id' ) ; element . removeAttribute ( 'data-ignore-composition' ) ; element . removeEventListener ( 'input' , inputHandler ) ; element . removeEventListener ( 'compositionstart' , compositionHandler ) ; element . removeEventListener ( 'compositionupdate' , compositionHandler ) ; element . removeEventListener ( 'compositionend' , compositionHandler ) ; untrackListeners ( listeners ) ; if ( debug === true ) { removeDebugListeners ( element ) ; } }
Unbinds eventListener from input field
 @param  {HTMLElement} element textarea, input
Unbinds eventListener from input field @param { HTMLElement } element textarea input