Skip to main content

tagInput

Tags a TaggableElement to be tracked as InputContext.

tagInput = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue

Parameters

typedefault value
requiredidstring
optionaloptionsTagLocationOptions{ trackBlurs: true }
optionalonErrorTrackerErrorHandlerCallbackconsole.error

Returns

TagLocationReturnValue

Events

Unless customized via the options parameter, automatically triggers:

Usage example

import { tagInput } from '@objectiv/tracker-browser';
<input {...tagInput({ id: 'search' })} />
<Search {...tagInput({ id: 'search' })} />

Did you know ?

tagInput is just syntactic sugar on top of tagLocation.