MCPcopy Create free account
hub / github.com/SyntaxUI/syntaxui / handleBlur

Function handleBlur

src/showcase/components/input/TagInput.tsx:66–73  ·  view source on GitHub ↗
(event: React.FocusEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

64 }
65 // Adds the keyword when the input loses focus, if there's a keyword to add
66 const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {
67 if (inputValue.trim() !== '' && event.relatedTarget?.tagName !== 'BUTTON') {
68 const newKeywords = [...keywords, inputValue.trim()]
69 setKeywords(newKeywords)
70 onKeywordsChange(newKeywords)
71 setInputValue('')
72 }
73 }
74
75 // Removes a keyword from the list
76 const removeKeyword = (indexToRemove: number) => {

Callers 1

TagInputFunction · 0.85

Calls 1

onKeywordsChangeFunction · 0.85

Tested by

no test coverage detected