๐คEvent Handling
To which other events can you listen?
Event Handlers
List of supported events can be found here. Some of the commonly used ones are listed below:
Clipboard Events
Event names:
onCopy onCut onPasteProperties:
DOMDataTransfer clipboardDataComposition Events
Event names:
onCompositionEnd onCompositionStart onCompositionUpdateProperties:
string dataKeyboard Events
Event names:
onKeyDown onKeyPress onKeyUpProperties:
boolean altKey
number charCode
boolean ctrlKey
boolean getModifierState(key)
string key
number keyCode
string locale
number location
boolean metaKey
boolean repeat
boolean shiftKey
number whichFocus Events
Event names:
onFocus onBlurThese focus events work on all elements in the React DOM, not just form elements.
Properties:
DOMEventTarget relatedTargetForm Events
Event names:
onChange onInput onInvalid onSubmitFor more information about the onChange event, see Forms.
Mouse Events
Event names:
onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit
onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave
onMouseMove onMouseOut onMouseOver onMouseUpThe onMouseEnter and onMouseLeave events propagate from the element being left to the one being entered instead of ordinary bubbling and do not have a capture phase.
Properties:
boolean altKey
number button
number buttons
number clientX
number clientY
boolean ctrlKey
boolean getModifierState(key)
boolean metaKey
number pageX
number pageY
DOMEventTarget relatedTarget
number screenX
number screenY
boolean shiftKeySelection Events
Event names:
onSelectTouch Events
Event names:
onTouchCancel onTouchEnd onTouchMove onTouchStartProperties:
boolean altKey
DOMTouchList changedTouches
boolean ctrlKey
boolean getModifierState(key)
boolean metaKey
boolean shiftKey
DOMTouchList targetTouches
DOMTouchList touchesUI Events
Event names:
onScrollProperties:
number detail
DOMAbstractView viewWheel Events
Event names:
onWheelProperties:
number deltaMode
number deltaX
number deltaY
number deltaZMedia Events
Event names:
onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted
onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay
onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend
onTimeUpdate onVolumeChange onWaitingImage Events
Event names:
onLoad onErrorAnimation Events
Event names:
onAnimationStart onAnimationEnd onAnimationIterationProperties:
string animationName
string pseudoElement
float elapsedTimeTransition Events
Event names:
onTransitionEndProperties:
string propertyName
string pseudoElement
float elapsedTimeOther Events
Event names:
onToggleLast updated
Was this helpful?