useKendoPaste
Hook
A React hook that subscribes a component to smart paste events. When a SmartPasteButton dispatches a populate event, this hook will call the onValueChange callback if the event contains a value for the specified field.
The field is identified by the name or id prop of the component.
Works with both KendoReact Form components and native HTML form elements.
Definition
Package:@progress/kendo-react-common
Syntax:
tsx
const inputRef = React.useRef<HTMLInputElement>(null);
const [value, setValue] = React.useState('');
// Using name prop as field identifier
useKendoPaste(inputRef, {
fieldName: 'firstName', // matches the name prop
onValueChange: (newValue) => setValue(newValue)
});
return <input ref={inputRef} name="firstName" value={value} onChange={(e) => setValue(e.target.value)} />;