@neovici/cosmoz-input
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -6,4 +6,3 @@ import { useCallback, useEffect, useRef } from '@pionjs/pion'; | ||
const inputRef = useRef(undefined); | ||
const onRef = useCallback((el) => (inputRef.current = el), []); | ||
const root = host.shadowRoot, onChange = useCallback((e) => host.dispatchEvent(new Event(e.type, { bubbles: e.bubbles })), []), onInput = useCallback((e) => notifyProperty(host, 'value', e.target.value), []), onFocus = useCallback((e) => notifyProperty(host, 'focused', e.type === 'focus'), []), focus = useCallback(() => inputRef.current?.focus(), []), validate = useCallback(() => { | ||
const onRef = useCallback((el) => (inputRef.current = el), []), onChange = useCallback((e) => host.dispatchEvent(new Event(e.type, { bubbles: e.bubbles })), []), onInput = useCallback((e) => notifyProperty(host, 'value', e.target.value), []), onFocus = useCallback((e) => notifyProperty(host, 'focused', e.type === 'focus'), []), focus = useCallback(() => inputRef.current?.focus(), []), validate = useCallback(() => { | ||
const valid = inputRef.current?.checkValidity(); | ||
@@ -27,4 +26,4 @@ host.toggleAttribute('invalid', !valid); | ||
}; | ||
root.addEventListener('mousedown', onMouseDown); | ||
return () => root.removeEventListener('mousedown', onMouseDown); | ||
host.addEventListener('mousedown', onMouseDown); | ||
return () => host.removeEventListener('mousedown', onMouseDown); | ||
}, [focus]); | ||
@@ -31,0 +30,0 @@ return { |
{ | ||
"name": "@neovici/cosmoz-input", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "A input web component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18434
450