subscribeToKendoPaste
Function
Definition
Package:@progress/kendo-react-common
Syntax:
tsx
class MyComponent extends React.Component {
private KendoPasteSubscription?: KendoPasteSubscription;
componentDidMount() {
this.KendoPasteSubscription = subscribeToKendoPaste(this.element, {
fieldName: this.props.name,
onValueChange: (value) => this.handleSmartPasteValue(value)
});
}
componentWillUnmount() {
this.KendoPasteSubscription?.unsubscribe();
}
}
Subscribe to smart paste events for class components. Call this in componentDidMount and store the result. Call unsubscribe() in componentWillUnmount.
Parameters:elementundefined | null | Element
The DOM element to use for finding the event target
optionsKendoPasteSubscriptionOptionsConfiguration options for the smart paste subscription
Returns:A subscription object with an unsubscribe method