remove half-baked onBlur handling
This commit is contained in:
@@ -100,15 +100,6 @@ export function TagInput({
|
|||||||
setValue(v)
|
setValue(v)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const onBlur = React.useCallback(() => {
|
|
||||||
const tag = sanitize(value)
|
|
||||||
|
|
||||||
if (tag.length > 0) {
|
|
||||||
handleChangeTags(uniq([...tags, tag]).slice(0, max))
|
|
||||||
setValue('')
|
|
||||||
}
|
|
||||||
}, [value, tags, max, handleChangeTags])
|
|
||||||
|
|
||||||
const removeTag = React.useCallback(
|
const removeTag = React.useCallback(
|
||||||
(tag: string) => {
|
(tag: string) => {
|
||||||
handleChangeTags(tags.filter(t => t !== tag))
|
handleChangeTags(tags.filter(t => t !== tag))
|
||||||
@@ -135,7 +126,6 @@ export function TagInput({
|
|||||||
onKeyPress={onKeyPress}
|
onKeyPress={onKeyPress}
|
||||||
onSubmitEditing={onSubmitEditing}
|
onSubmitEditing={onSubmitEditing}
|
||||||
onChangeText={onChangeText}
|
onChangeText={onChangeText}
|
||||||
onBlur={onBlur}
|
|
||||||
blurOnSubmit={false}
|
blurOnSubmit={false}
|
||||||
style={[styles.input, pal.textLight]}
|
style={[styles.input, pal.textLight]}
|
||||||
placeholder="Enter a tag and press enter"
|
placeholder="Enter a tag and press enter"
|
||||||
|
|||||||
Reference in New Issue
Block a user