MCPcopy Index your code
hub / github.com/caseywebdev/react-list / constructSelectEvent

Function constructSelectEvent

docs/index.js:5763–5799  ·  view source on GitHub ↗
(dispatchQueue, nativeEvent, nativeEventTarget)

Source from the content-addressed store, hash-verified

5761 lastSelection = null,
5762 mouseDown = !1;
5763function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
5764 var doc =
5765 nativeEventTarget.window === nativeEventTarget
5766 ? nativeEventTarget.document
5767 : 9 === nativeEventTarget.nodeType
5768 ? nativeEventTarget
5769 : nativeEventTarget.ownerDocument;
5770 mouseDown ||
5771 null == activeElement ||
5772 activeElement !== getActiveElement(doc) ||
5773 ((doc = activeElement),
5774 "selectionStart" in doc && hasSelectionCapabilities(doc)
5775 ? (doc = { start: doc.selectionStart, end: doc.selectionEnd })
5776 : ((doc = (
5777 (doc.ownerDocument && doc.ownerDocument.defaultView) ||
5778 window
5779 ).getSelection()),
5780 (doc = {
5781 anchorNode: doc.anchorNode,
5782 anchorOffset: doc.anchorOffset,
5783 focusNode: doc.focusNode,
5784 focusOffset: doc.focusOffset
5785 })),
5786 (lastSelection && shallowEqual(lastSelection, doc)) ||
5787 ((lastSelection = doc),
5788 (doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect")),
5789 0 < doc.length &&
5790 ((nativeEvent = new SyntheticEvent(
5791 "onSelect",
5792 "select",
5793 null,
5794 nativeEvent,
5795 nativeEventTarget
5796 )),
5797 dispatchQueue.push({ event: nativeEvent, listeners: doc }),
5798 (nativeEvent.target = activeElement))));
5799}
5800function makePrefixMap(styleProp, eventName) {
5801 var prefixes = {};
5802 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();

Callers 1

Calls 4

getActiveElementFunction · 0.85
hasSelectionCapabilitiesFunction · 0.85
shallowEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…